Differences in species richness at different elevations are widespread and important for conservation, but the causes of these patterns remain poorly understood. Here, we use a phylogenetic perspective to address the evolutionary and biogeographic processes that underlie elevational diversity patterns within a region. We focus on a diverse but well-studied fauna of tropical amphibians, the hylid frogs of Middle America. Middle American treefrogs show a “hump-shaped” pattern of species richness (common in many organisms and regions), with the highest regional diversity at intermediate elevations. We reconstructed phylogenetic relationships among 138 species by combining new and published sequence data from 10 genes and then used this phylogeny to infer evolutionary rates and patterns. The high species richness of intermediate elevations seems to result from two factors. First, a tendency for montane clades to have higher rates of diversification. Second, the early colonization of montane regions, leaving less time for speciation to build up species richness in lowland regions (including tropical rainforests) that have been colonized more recently. This “time-for-speciation” effect may explain many diversity patterns and has important implications for conservation. The results also imply that local-scale environmental factors alone may be insufficient to explain the high species richness of lowland tropical rainforests, and that diversification rates are lower in earth's most species-rich biome.