How biotic interactions, current and historical environment, and biogeographic barriers determine community structure is a fundamental question in ecology and evolution, especially in diverse tropical regions. To evaluate patterns of local and regional diversity, we quantified the phylogenetic composition of 189 hummingbird communities in Ecuador. We assessed how species and phylogenetic composition changed along environmental gradients and across biogeographic barriers. We show that humid, low-elevation communities are phylogenetically overdispersed (coexistence of distant relatives), a pattern that is consistent with the idea that competition influences the local composition of hummingbirds. At higher elevations communities are phylogenetically clustered (coexistence of close relatives), consistent with the expectation of environmental filtering, which may result from the challenge of sustaining an expensive means of locomotion at high elevations. We found that communities in the lowlands on opposite sides of the Andes tend to be phylogenetically similar despite their large differences in species composition, a pattern implicating the Andes as an important dispersal barrier. In contrast, along the steep environmental gradient between the lowlands and the Andes we found evidence that species turnover is comprised of relatively distantly related species. The integration of local and regional patterns of diversity across environmental gradients and biogeographic barriers provides insight into the potential underlying mechanisms that have shaped community composition and phylogenetic diversity in one of the most species-rich, complex regions of the world.