Cork oak is a tree species with ecological importance that contributes to economic and social development in the Mediterranean region. Cork oak decline is a major concern for forest sustainability and has negative impacts on cork oak growth and production. This event has been increasingly reported in the last decades and seems to be related with climate changes. Biscogniauxia mediterranea is an endophytic fungus of healthy cork oak trees that turns into a pathogen in trees weaken by environmental stress. Understanding the drivers of B. mediterranea populations diversity and differentiation is expected to allow a better control of cork oak decline and preserve forest sustainability. Endophyte isolates from different cork oak forests were identified as B. mediterranea and their genetic diversity was evaluated using phylogenetic and microsatellite-primed PCR analyses. Genetic diversity and variability of this fungus was correlated with environmental/phytosanitary conditions present in forests/trees from which isolates were collected. High genetic diversity and variability was found in B. mediterranea populations obtained from different forests, suggesting some degree of isolation by distance. Bioclimate was the most significant effect that explained the genetic variability of B. mediterranea, rather than precipitation or temperature intensities alone or disease symptoms. These findings bring new implications for the changing climate to cork oak forests sustainability, cork production and quality.