Genome sequencing of spatially distributed individuals sheds light on how evolution structures genetic variation. Populations of Phellopilus nigrolimitatus, a red-listed wood-inhabiting fungus associated with old-growth coniferous forests, have decreased in size over the last century due to a loss of suitable habitats. We assessed the population genetic structure and investigated local adaptation in P. nigrolimitatus, by establishing a reference genome and genotyping 327 individuals sampled from 24 locations in Northern Europe by RAD sequencing. We revealed a shallow population genetic structure, indicating large historical population sizes and high levels of gene flow. Despite this weak substructuring, two genetic groups were recognized; a western group distributed mostly in Norway and an eastern group covering most of Finland, Poland and Russia. This substructuring may reflect coimmigration with the main host, Norway spruce (Picea abies), into Northern Europe after the last ice age. We found evidence of low levels of genetic diversity in southwestern Finland, which has a long history of intensive forestry and urbanization. Numerous loci were significantly associated with one or more environmental factors, indicating adaptation to specific environments. These loci clustered into two groups with different associations with temperature and precipitation. Overall, our findings indicate that the current population genetic structure of P. nigrolimitatus results from a combination of gene flow, genetic drift and selection. The acquisition of similar knowledge especially over broad geographic scales, linking signatures of adaptive genetic variation to evolutionary processes and environmental variation, for other fungal species will undoubtedly be useful for assessment of the combined effects of habitat fragmentation and climate change on fungi strongly bound to old-growth forests.