Aim: To investigate the influence of bioclimatic, productivity and topographic variables on avian diversity patterns in riparian habitats along a savanna/humid forest environmental gradient. We investigate how this gradient affects patterns of taxonomic and phylogenetic alpha and beta diversities, and whether the changes observed along the river are the result of taxonomic (and phylogenetic) replacement or nestednessresultant dissimilarities. We also explore a potential ecological mechanism to account for differences in species richness along the gradient. Location: Basin of the Rio Branco, northern Amazonia, Brazil. Taxa: An avian community of 325 bird species. Methods: We sampled avian communities using standardized avian point counts at 16 localities, systematically distributed along the Rio Branco and two of its major tributaries. We compared patterns of species richness using rarefied numbers of species detected, and patterns of phylogenetic diversity with a community-wide consensus tree. In addition, we partitioned beta diversity in species replacement and nestedness-resultant dissimilarities. We reduced predictor variables using a principal components analysis, correlating locality scores with changes in diversity. We tested the effect of climatic variables on beta diversity with a distance-based redundancy analysis (dbRDA). Results: Patterns of avian composition and species richness were highly correlated with climatic and productivity variables. We found more bird species in less arid localities with higher annual precipitation, and in areas with lower annual temperatures, lower evapotranspiration and less temperature variation throughout the year. Despite differences in species richness, the number of individuals remained relatively similar along the gradient. However, species-rich localities presented lower average species frequency and median avian biomass. Patterns of taxonomic and phylogenetic beta diversity were correlated with the climatic gradient and were due to species replacements. Main conclusions: Climate represents a major player in structuring avian communities along the Rio Branco, affecting distinct levels of avian diversity organization. We found evidence of species packing, a mechanism to fit more species in the communities. Patterns of species replacement highlight the importance of transitional zones | 2329 NAKA et Al.