Aim The composition of communities is known to be influenced by biogeographical history, but also by local environmental conditions. Yet few studies have evaluated the relative importance of the direct and indirect effects of multiple factors on species diversity in rich Neotropical forests. Our study aims to assess drivers of change in local bird species richness in lowland tropical rain forests.Location Thirty-two physiographic subregions along the corridor of the Panama Canal, Panama.Methods We mapped the distributions of all forest-dwelling bird species and quantified the environmental characteristics of all subregions, including mean annual rainfall, topographic complexity, elevational variability, forest age and forest area. Plant species richness, believed to be correlated with structural complexity, was estimated by interpolation through kriging for subregions where data were unavailable.Results The study region has a strong rainfall gradient across a short distance (65 km), which is also accompanied by steep gradients in plant and bird species diversity. Path analysis showed that precipitation strongly affected plant species diversity, which in turn affected avian diversity. Forest age and topography affected bird diversity independently of plant diversity. Forest area and its proportion occurring in the largest two fragments of each subregion (habitat configuration) were also positive correlates of bird species richness.Main conclusions Our results suggest that plant species richness, known to be influenced in part by biogeographical history and geology, also affects bird species assemblages locally. We provide support for the hypothesis that bird species richness increases with structural complexity of the habitat. Our analysis of the distributions of the region's most disturbance-sensitive bird species showed that subregions with more rainfall, more complex topography and older forests harboured not only richer communities but also more sensitive species; while subregions with the opposite characteristics usually lacked large fractions of the regional forest bird community and hosted only common, widely distributed species. Results also emphasize the importance of preserving forest diversity from habitat loss and fragmentation, and confirm that larger, continuous forest tracts are necessary to maintain the rich avian diversity in the region.