Population genetic patterns of species at their range margin have important implications for species conservation. We performed allozyme electrophoresis of 19 loci to investigate patterns of the genetic structure of 17 populations (538 individuals) of the butterfly Polyommatus coridon, a monophagous habitat specialist with a patchy distribution. The butterfly and its larval food plant Hippocrepis comosa reach their northern distribution margin in the study region (southern Lower Saxony, Germany). Butterfly population size increased with host plant population size. The genetic differentiation between populations was low but significant (FST = 0.013). No isolation-by-distance was found. Hierarchical F-statistics revealed significant differentiation between a western and an eastern subregion, separated by a river valley. The combination of genetic and ecological data sets revealed that the expected heterozygosity (mean: 18.5%) decreased with increasing distance to the nearest P. coridon population. The population size of P. coridon and the size of larval food plant population had no effect on the genetic diversity. The genetic diversity of edge populations of P. coridon was reduced compared to populations from the centre of its distribution. This might be explained by (i) an increasing habitat fragmentation towards the edge of the distribution range and/or (ii) a general reduction of genetic variability towards the northern edge of its distribution.