Fungal communities associated with roots play a key role in nutrient uptake and in mitigating the abiotic and biotic stress of their host. In this study, we characterized the roots mycobiome of wild and cultivated pearl millet [Pennisetum glaucum (L.) R. Br., synonym: Cenchrus americanus (L.) Morrone] in three agro-ecological areas of Senegal following a rainfall gradient. We hypothesized that wild pearl millet could serve as a reservoir of endophytes for cultivated pearl millet. We therefore analyzed the soil factors influencing fungal community structure and whether cultivated and wild millet shared the same fungal communities. The fungal communities associated with pearl millet were significantly structured according to sites and plant type (wild vs cultivated). Besides, soil pH and phosphorus were the main factors influencing the fungal community structure. We observed a higher fungal diversity in cultivated compared to wild pearl millet. Interestingly, we detected higher relative abundance of putative pathotrophs, especially plant pathogen, in cultivated than in wild millet in semi-arid and semi-humid zones, and higher relative abundance of saprotrophs in wild millet in arid and semi-humid zones. A network analysis based on taxa co-occurrence patterns in the core mycobiome revealed that cultivated millet and wild relatives had dissimilar groups of hub taxa. The identification of the core mycobiome and hub taxa of cultivated and wild pearl millet could be an important step in developing microbiome engineering approaches for more sustainable management practices in pearl millet agroecosystems.