In forest soils, the pools of N and P available for microbes and plants are strongly dependent on soil properties. Here, we conducted a P and N fertilization experiment to disentangle the effects of nutrient availability on soil-residing, root-associated and ectomycorrhizal fungi in beech (Fagus sylvativa) forests differing in P availability. We tested the hypothesis that in P-poor forests, P fertilization leads to enhanced fungal diversity in soil and roots, resulting in enhanced P nutrition of beech and that N fertilization aggravates P shortage, shifting the fungal communities towards nitrophilic species. In response to fertilizer treatments (1x 50 kg ha−1 P, 5x 30 kg ha−1 N within 2 years), the labile P fractions increased in soil and roots, regardless of plant-available P in soil. Root total P decreased in response to N fertilization and root total P increased at the low P site in response to P addition. The relative abundances of ectomycorrhizal fungi, but not their species richness, increased in response to P or N addition in comparison with that of saprotrophic fungi. While some fungal orders (Trechisporales, Atheliales, Cantharellales) were moderately decreased in response to fertilizer treatments, Boletales increased in response to P and Russulaes to N addition. N or P fertilization resulted in functional trade-off, shifting away from saprotrophic towards symbiotrophic potential. Our results suggest that chronic exposure of forest ecosystems to increased nutrient inputs may overcome the resistance of the resident mycobiome structures resulting in nutritional imbalance and loss of forest ecosystem services.