When antimicrobial resistant bacteria (ARB) and genes (ARGs) reach novel habitats, they can become part of the habitat's microbiome in the long term if they are able to overcome the habitat's biotic resilience towards immigration. This process should become more difficult with increasing biodiversity, as exploitable niches in a given habitat are reduced for immigrants when more diverse competitors are present. Consequently, microbial diversity could provide a natural barrier towards antimicrobial resistance by reducing the persistence time of immigrating ARB and ARG. To test this hypothesis, a pan-European sampling campaign was performed for structured forest soil and dynamic riverbed environments of low anthropogenic impact. In soils, higher diversity, evenness and richness were significantly negatively correlated with relative abundance of >85% of ARGs. Furthermore, the number of detected ARGs per sample were inversely correlated with diversity. However, no such effects were present in the more dynamic riverbeds. Hence, microbiome diversity can serve as a barrier towards antimicrobial resistance dissemination in stationary, structured environments, where long-term, diversity-based resilience against immigration can evolve. A study based on a pan-European survey of soils and riverbeds of low-anthropogenic impact suggests that environmental microbiomes with a higher degree of bacterial diversity host less diverse and lower abundances of antibiotic resistance genes. [ABSTRACT FROM AUTHOR]