Microbial assemblages naturally living on the skin are an integral part of immunity. In amphibians, this skin microbiota may hold a mitigation solution against the fungal pathogen Batrachochytrium dendrobatidis (Bd), which causes the panzootic disease chytridiomycosis. We used 16S rRNA gene metabarcoding to test the adaptive microbiome hypothesis. We compared the community composition, richness, and putative Bd-inhibitory function of the skin microbiome of three amphibian host species in the Pyrenees, as well as three species in Taiwan, in both Bd-positive and negative mountain populations. In both geographical regions, the amphibian host species played a decisive role in shaping the microbial assemblage and putative anti-Bd properties. In the Pyrenees, the species most susceptible to chytridiomycosis, Alytes obstetricans, had the lowest relative abundances of putative protective bacteria. In Bd-positive and negative sites, individuals had different skin microbiomes, with all anuran species showing increased relative abundances of potential anti-Bd bacteria, while the Taiwanese caudata Hynobius sonani showed the opposite pattern. Our results suggest that, in response to exposure to the pathogen, the skin microbiota shifted to a defensive state with increased anti-Bd function, which may contribute to promoting disease resistance, as proposed by the adaptive microbiome hypothesis.