Bryophytes dominate some ecosystems despite their extraordinary sensitivity to habitat quality. Nevertheless, some species behave differently across various regions. The existence of local adaptations is questioned by a high dispersal ability, which is thought to redistribute genetic variability among populations. Although Sphagnum warnstorfii is an important ecosystem engineer in fen peatlands, the causes of its rather wide niche along the pH/calcium gradient are poorly understood. Here, we studied the genetic variability of its global populations, with a detailed focus on the wide pH/calcium gradient in Central Europe. Principal coordinates analysis of 12 polymorphic microsatellite loci revealed a significant gradient coinciding with water pH, but independent of geography; even samples from the same fens were clearly separated along this gradient. However, most of the genetic variations remained unexplained, possibly because of the introgression from phylogenetically allied species. This explanation is supported by the small heterogeneous cluster of samples that appeared when populations morphologically transitional to S. subnites, S. rubellum, or S. russowii were included into the analysis. Alternatively, this unexplained variation might be attributed to a legacy of glacial refugia with recently dissolved ecological and biogeographic consequences. Isolation by distance appeared at the smallest scale only (up to 43 km). Negative spatial correlations occurred more frequently, mainly at long distances (up to 950 km), implying a genetic similarity among samples which are very distant geographically. Our results confirm the high dispersal ability of peatmosses, but simultaneously suggested that their ability to cope with a high pH/calcium level is at least partially determined genetically, perhaps via specific physiological mechanisms or a hummock-forming ability.