© 2019 John Wiley & Sons Ltd Aim: The factors driving microbial community β-diversity (variation in composition) at different spatial scales yield fundamental insights into the mechanisms that maintain ecosystem biodiversity, which as yet are uncertain. Here, we explore whether spatial scale-dependent patterns of β-diversity vary between microbial functional groups and bacterial taxa (i.e., diazotrophic and bacterial communities) across local to regional scales (from metres to hundreds of kilometres). Location: Eastern China. Time period: October and November 2015. Major taxa studied: Diazotrophic and bacterial communities. Methods We use two complementary statistical tools to unveil biotic mechanisms (i.e., species association) underlying variation in β-diversity of diazotrophic and bacterial communities. We examined distance–decay slopes of both communities at the local (1–113 m), meso- (3.4–39 km) and regional (103–668 km) scales. We used an environmentally constrained checkerboard score and topological features of association networks as indices of species association. We then calculated contributions of species association, abiotic factors and geographical distance to explain community β-diversity. The scale-dependent distance–decay relationships were also examined in ubiquitous (high occupancy across samples) and endemic communities of diazotrophs and bacteria. Results Diazotrophs displayed steeper distance–decay slopes than bacteria, suggesting that the β-diversity of diazotrophic communities was more variable. The distance–decay slopes were dependent on spatial scales in both communities, owing to different contributions of geographical distance, abiotic factors and species association at three spatial scales. Intriguingly, species association was greater and contributed more to community β-diversity than other forces at the local scale, implying that species association could greatly alter community structures. Main conclusions Drivers of diazotrophic and bacterial community β-diversity depended on spatial scales, resulting in different distance–decay patterns. Moreover, this was the first study to use two methods to demonstrate that species association played important, but as yet unrecognized, roles in driving spatial scale-dependent β-diversity.