Soil fungi have important effects on plant performance and nutrient cycling. To understand the dynamics of the soil fungal community and their response to changes in understory plants and soil properties after afforestation, we investigated a cropland site (CL) and three Pinus tabulaeformis plantation sites with different ages (15, 30, and 45 yr) in the Ziwuling Mountains, Loess Plateau, China. Afforestation increased the soil organic carbon (SOC), total nitrogen (TN), total phosphorus (TP), NO À 3 -N, and NH þ 4 -N contents but decreased the available phosphorus (AP). The biomass and diversity of plants decreased in the herb layer with plantation age, and the biomass of plants increased in the shrub layer. Compared with cropland, the soil fungal diversity indices decreased significantly after afforestation. The soil fungal communities were dominated by Ascomycetes in CL and the 15-year-old plantation, whereas Basidiomycota dominated in the 30-and 45-year-old sites. Correlation analysis showed that the understory vegetation influenced the richness indices more than the diversity indices for the soil fungal community, and herb layer plants had stronger effects on the core soil fungal communities than the shrub layer plants. Soil organic carbon, TN, AP, C:P ratio, and N:P ratio were significantly correlated with the soil fungal communities. Moreover, the C:P ratio and N:P ratio increased as the forest age increased, thereby indicating that P was a crucial influence factor that affected the development of the soil fungal community in P. tabulaeformis plantations.