The local spatial genetic structures of cave-associated plants are seldom studied. Given that these plants are mainly confined to small areas in and around the entrances of caves, we hypothesized that they might lack genetic structures at local scales. To test this hypothesis, we sampled two large populations (named D and T) of a critically endangered perennial herb, Primulina tabacum, which is endemic to karst caves in southern China. We analysed nine microsatellite loci and sequenced four chloroplast DNA (cpDNA) intergenic spacer regions to study the genetic diversity and structure within and between both populations. Both populations have distinct genetic characteristics. Samples from two subpopulations in population D showed considerable genetic divergence. This is not consistent with the hypothesis that P. tabacum has a weak genetic structure at a local scale. However, 94% of the individuals in population T shared the same multilocus genotype, which indicates little genetic structure within this population. The contributions of seed flow, pollen flow and (sub)population history to the genetic diversity and structure in each and both populations are discussed. Our study is the first to investigate local genetic diversity and structure in a cave-associated plant, and provides valuable information for the sustainable conservation of such species.