The goal of this study was to evaluate the role of common ancestry, and of geographical or reproductive isolation, in genetic divergence in populations of threespine sticklebacks (Gasterosteus aculeatus). Using seven DNA microsatellite loci we compared the effects of habitat type, drainage system and geographical proximity on genetic distance among 16 populations situated in an area in Schleswig-Holstein (Germany) that became deglaciated ≈12 000 years ago. Stickleback population structure correlated only weakly with drainage system, whereas the primary divergence was among habitat types. Phylogenetic analysis revealed that lake (n = 7) and river (n = 5) populations formed two distinct clades (Cavalli-Sforza’s and Edwards’ chord distance, 82–100% bootstrap support) at approximately equal genetic distances to a third clade, comprising putative estuarine (n = 4) ancestors. Allele frequencies in lake and river populations represented different subsets of the genetically more diverse estuarine populations. In nested amovas approximately twice the genetic variance was distributed among lake vs. river vs. estuarine populations as compared with the combined effects of drainage system and geographical distance. Limited gene flow between habitat types must have been established after postglacial colonization, suggesting ecological hybrid inferiority or behavioural mating barriers between ecotypes. Within estuarine and lake populations, population differentiation followed an isolation-by-distance model. Given the high observed heterozygosities within the 16 study populations (HO = 0.65–0.87), the mean divergence between lake and river population pairs (FST = 0.18 ± 0.007) would be reached after 300–6000 generations in a stepwise mutation model, depending on the size of Ne. This demonstrates both the utility of hypervariable microsatellites for detecting recent population divergences and the danger of operating at temporal or spatial scales which are beyond their resolution.