Abstract. The distribution of species on elevational gradients challenges our understanding of ecological processes, particularly in the context of biotic responses to climate change. We report here the distribution of leaf-litter ants on the Barva Transect, a continuous gradient of wet forest on Costa Rica's Atlantic slope. Seven sites were sampled, distributed from 50 to 2000 m. Worker density and microsite occupancy were high and relatively constant from 50 m to 1500 m and then abruptly dropped to near zero at 2000 m. Species density at the 1 m 2 scale was high and constant to 1070 m and then declined at higher elevations.Species richness of assemblages at the 1 km 2 scale was constant or rose slightly from 50 m to 500 m and then steeply declined. Because assemblage richness and species density declined more rapidly than worker density, density compensation with elevation is suggested and supported by a measure of mean population density. Statistically, temperature was the best predictor of both species richness and worker density. Relative humidity, soil nutrients, elevation-specific regional area, and the mid-domain effect were poor predictors of richness. Sites from 50 m to 500 m were similar in species composition. In contrast, assemblages at 1070 m, 1500 m, and 2000 m were highly differentiated. Thus elevational ranges were narrow for species at mid to upper elevations and broad for those at the lowest elevations. Density compensation at higher elevation suggests that if temperature or productivity are influencing the decline in diversity it must be indirectly through speciation and extinction processes, rather than by greater numbers of individuals. The broad ranges of lowland species may be a response to as yet unmeasured environmental factors (e.g., NPP) or to climate changes associated with the current interglacial period. Interglacial warming may have driven species to higher elevations, but the lack of competitors at the lower range margins may have allowed the lowest-elevation species to move upslope without a concomitant contraction of the lower range boundary. Global warming threatens a loss of narrowly-distributed montane species, but lowland biotic attrition may be ameliorated by range expansion among lowland species.