Peat mosses are a key functional group in peatlands, driving biogeochemical cycles, habitat development and changes in species composition. They are generally intolerant of calcium and magnesium bicarbonate, but some species are adapted to mineral-rich fens. A previous study found a coincidence between genetic variation and the ability to tolerate high pH/calcium levels in Sphagnum warnstorfii. Here we compare its microsatellite variation with that of two rarer calcium-tolerant species (Sphagnum subnitens, S. contortum), using a novel data set from Eurasia. Because physiological experiments indicate that S. warnstorfii can tolerate high magnesium levels, we included also samples from dolomite and serpentinite. Genetic diversity of S. warnstorfii was higher than that of other species. The Bayesian analysis in program Structure resulted in two population groups of S. warnstorfii. One group coincided with dolomite (Italy, Austria, Estonia) and moderately magnesium-rich (but calcium-poor) rocks (serpentinite, metadolerite, cordieritebearing migmatite on the Bohemian Massif), while the second one coincided with magnesiumpoor bedrock across Eurasia. The principal coordinate analysis revealed a cline between populations from magnesium-rich and magnesium-poor bedrocks, with populations from dolomite and serpentinite forming one extreme. Populations from magnesium-poor bedrock located far from any dolomite or serpentinite formed the opposite extreme of the cline. We demonstrate for the first time that magnesium toxicity may drive bryophyte microevolution, as has repeatedly been shown for vascular plants, including ferns. K e y w o r d s: Bryophyta,