Plant populations occupying different habitats may diverge from each other over time and gradually accumulate genetic and morphological differences, ultimately resulting in ecotype or even species formation. In plant species that critically rely on mycorrhizal fungi, differences in mycorrhizal communities can contribute to ecological isolation by reducing or even inhibiting germination of immigrant seeds. In this study, we investigated whether the mycorrhizal communities available in the soil and associating with the roots of seedlings and adult plants of the partially mycoheterotrophic Pyrola rotundifolia differed between populations growing in sand dunes and forests. In addition, reciprocal germination experiments were performed to test whether native seeds showed higher germination than immigrant seeds. Our results showed that the mycorrhizal communities differed significantly between forest and dune populations, and that within populations seedlings and adults also associated with different mycorrhizal communities. In both forest and dune populations, mycorrhizal communities were dominated by members of the Thelephoraceae, but dune populations showed a higher incidence of members of the Inocybaceae, whereas forest populations showed a high abundance of members of the Russulaceae. Reciprocal germination experiments showed that native seeds showed a higher germination success than immigrant seeds and this effect was most pronounced in dune populations. Overall, these results demonstrate that plants of P.rotundifolia growing in dune and forest habitats associate with different mycorrhizal communities and that reduced germination of non-native seeds may contribute to reproductive isolation. We conclude that selection against immigrants may constitute an important reproductive barrier at early stages of the speciation process.