Across the world's mountains, elevation-species richness relationships are highly variable. Here, using data on bird species elevational distributions from all 46 of the world's major mountain ranges, bird species dietary traits, and the distribution of the low-elevation ant genus Oecophylla, we show that global patterns in bird elevational diversity are likely to be affected by competition with ants. Oecophylla is an exceptionally abundant and aggressive predator of invertebrates, which preys on the same species that sympatric invertivorous bird species feed on. In mountain ranges with Oecophylla present in the foothills, maximum species richness of invertivorous birds occurs, on average, at 960m, ~450m higher than in mountain ranges without Oecophylla. Further, in mountain ranges with Oecophylla, species richness of invertivorous birds increases initially with with elevation to produce a mid-elevation peak in invertivore bird species richness. Where Oecophylla is absent, invertivore bird species richness generally shows monotonic declines with increasing elevation. We attribute the pattern to the following mechanism: first, Oecophylla reduces prey density for invertivorous birds; second, low invertebrate prey abundance reduces invertivorous bird density and third, lower bird density is correlated with lower bird species richness. Because invertivores dominate montane bird communities, global elevational bird diversity patterns are also driven by Oecophylla. The findings emphasize how competitive interactions between distantly related taxa set geographical range limits.