AbstractAimDistinguishing ecological and evolutionary processes that structure assemblages can provide a comprehensive vision of the variation in species turnover in heterogeneous regions. However, the causes of spatial variation in organism assemblies in most of the Amazon still require further studies. In view of this, our objective was to determine the relative roles of species interactions, categorical and continuous environmental filters and isolation by distance in the taxonomic and functional composition of lizard assemblages.LocationAmazonian rainforest.TaxonLacertilia.MethodsWe sampled 14 sites along 880 km in the Madeira‐Purus interfluvial region, central‐south‐western Amazonia. We used multiple linear models applied to distance matrices, spatial correlograms and partitioned variance to distinguish the effects of geographical distances from environmental distances on lizard assemblages. Additionally, to better understand the effects of environmental gradients and forest type on species traits, we used a combination of RLQ and fourth‐corner analysis.ResultsVariance in taxonomic distance was mainly explained by a continuous environmental gradient that selects different species. Although we found no evidence of overdispersion or clustering of traits, functional distance was mainly explained by forest type and precipitation. The weak effect of geographical distance on lizard assemblages suggests that different environmental conditions have selected distinct subsets of species and functional traits.Main ConclusionsWe showed that the structural heterogeneity along an environmental gradient in Amazonia has a significant impact on the taxonomic and functional composition of lizard assemblages. Environmental filtering along the interfluvial region has caused species turnover and determined differences in the functional characteristics found between assemblages in dense and open forests. These results are relevant for conservation since local species or trait subsets change across the landscape and are therefore irreplaceable in the case of local extinction.