Distinguishing among the mechanisms underlying the spatial distribution of genetic variation resulting from the environmental or physical barriers from those arising due to simple geographic distance is challenging in complex landscapes. The Andean uplift represents one of the most heterogeneous habitats where these questions remain unexplored since multiple mechanisms may interact, confounding their relative roles. We explore this broad question in the leaf-cutting ant Atta cephalotes, a species that is distributed across the Andes mountains, using nuclear microsatellite markers and mtCOI gene sequences. We investigate spatial genetic divergence across the western range of the northern Andes in Colombia by testing the relative role of alternative scenarios of population divergence, including isolation by geographic distance (IBD), climatic conditions (IBE), and the physical barriers presented by the Andes mountains (IBB). Our results reveal substantial genetic differentiation among A. cephalotes populations for both types of markers, but only nuclear divergence followed a hierarchical pattern with multiple models of genetic divergence imposed by the western range. Model selection showed that the IBD, IBE (temperature and precipitation), and IBB (Andes mountains) models, often proposed as individual drivers of genetic divergence, interact and explain up to 33% of the genetic divergence in A. cephalotes. The IBE model remained significant after accounting for IBD, suggesting that environmental factors play a more prominent role than with IBB. These factors, in combination with the idiosyncratic dispersal patterns of ants, appear to determine the hierarchical patterns of gene flow. This study enriches our understanding of the forces shaping population divergence in complex habitat landscapes.