Abstract:[Objective] The long-term intense continuous cropping and abuse of mineral fertilizers result in the degradation of upland red soil and the accumulation of soil-borne plant pathogens. Fungi are the microorganisms closely related to soil health in agroecosystems. We investigated the changes of soil fungal community to explore the effects of hairy vetch (Vicia villosa Roth L.) application on the agroecosystem with upland red soil. [Methods] We employed quantitative polymerase chain reaction (qPCR) and high-throughput sequencing (Illumina MiSeq) to investigate the responses of fungal communities to mineral fertilizer (hereinafter referred to as NPK) alone and mineral fertilizer combined with hairy vetch (hereinafter referred to as NPKG) in upland red soil. [Results] Compared with NPK, NPKG increased the soil fertility, peanut yield, and fungal abundance and decreased soil pH and soil fungal diversity. Different treatments significantly altered the soil fungal community composition. Compared with NPK, NPKG increased the relative abundance of saprophytic fungi by 37.42% and decreased the relative abundance of Cercospora arachidicola and Lasidiplodia theobromae by 89.11% and 88.10%, respectively. [Conclusion] The application of hairy vetch significantly increased soil fertility, reduced the risk of peanut exposure to soil-borne diseases, and increased peanut yield in the upland red soil. Therefore, the application of hairy vetch was conducive to the sustainable development of upland red soil in southern China.