Human-altered environments can shape the evolution of organisms. Fungi are no exception, although little is known about how they withstand anthropogenic pollution. Here, we document adaptation in the mycorrhizal fungus Suillus luteus driven by soil heavy metal contamination. Genome scans across individuals from recently polluted and nearby unpolluted soils in Belgium revealed low divergence across isolates and no evidence of population structure based on soil type. However, we detected single nucleotide polymorphism divergence and gene copy-number variation, with different genetic combinations potentially conferring the ability to persist in contaminated soils. Variants were shared across the population but found to be under selection in isolates exposed to pollution and located across the genome, including in genes involved in metal exclusion, storage, immobilization and reactive oxygen species detoxification. Together, our results point to S. luteus undergoing the initial steps of adaptive divergence and contribute to understanding the processes underlying local adaptation under strong environmental selection.