An ecological approach was used to investigate the relationship between diversity of soil fungal communities and soil-borne pathogen inoculum in a potato growing area of northern Italy affected by yield decline. The study was performed in 14 sites with the same tillage management practices: 10 named ‘potato sites’, that for many years had been intensely cultivated with potatoes, and 4 named ‘rotation sites’, subject to a 4-year rotation without potatoes or any recurrent crop for many years. Fungal communities were recorded using conventional (soil fungi by plate count and endophytic fungi as infection frequency on pot-grown potato plant roots in soil samples) and molecular approaches [Basidiomycetes and Ascomycetes with specific and denaturing gradient gel electrophoresis (DGGE) analysis]. Diversity of fungal communities in potato sites was significantly lower than that in rotation sites. In addition, fungal communities in rotation sites showed lower Berger–Parker dominance than those in the potato sites, suggesting that rotation sites had a higher diversity as well as a better fungal community balance than potato sites. The ANalysis Of SIMilarity test of soil fungi and root endophytic fungi revealed that the two cropping systems differed significantly for species composition. Root endophytic fungal communities showed a greater ability to colonise potato roots in soil samples from potato sites than those from rotation sites. Moreover, the majority of endophytic root fungal community species in potato sites belonged to the potato root rot complex and storage disease (Colletotrichum coccodes, Fusarium solani and Fusarium oxysporum), while those in rotation sites were mainly ubiquitous or saprobic fungi. Soil rDNA analyses showed that Ascomycetes were much more frequent than Basidiomycetes in all the soils examined. DGGE analysis, with the Ascomycete-specific primer (ITS1F/ITS4A), did not reveal distinctions between the communities found at the potato and rotation sites, although the same analysis showed differences between the communities of Basidiomycetes (specific primer ITS1F/ITS4B). These findings showed that recurrent potato cropping affected diversity and composition of soil fungal communities and induced a shift in specialisation of the endophytic fungi towards potato.