Spatial and environmental heterogeneity are major factors in structuring species distributions in alpine landscapes. These landscapes have also been affected by glacial advances and retreats, causing alpine taxa to undergo range shifts and demographic changes. These nonequilibrium population dynamics have the potential to obscure the effects of environmental factors on the distribution of genetic variation. Here, we investigate how demographic change and environmental factors influence genetic variation in the alpine butterfly Colias behrii. Data from 14 microsatellite loci provide evidence of bottlenecks in all population samples. We test several alternative models of demography using approximate Bayesian computation (ABC), with the results favouring a model in which a recent bottleneck precedes rapid population growth. Applying independent calibrations to microsatellite loci and a nuclear gene, we estimate that this bottleneck affected both northern and southern populations 531–281 years ago, coinciding with a period of global cooling. Using regression approaches, we attempt to separate the effects of population structure, geographical distance and landscape on patterns of population genetic differentiation. Only 40% of the variation in FST is explained by these models, with geographical distance and least-cost distance among meadow patches selected as the best predictors. Various measures of genetic diversity within populations are also decoupled from estimates of local abundance and habitat patch characteristics. Our results demonstrate that demographic change can have a disproportionate influence on genetic diversity in alpine species, contrasting with other studies that suggest landscape features control contemporary demographic processes in high-elevation environments.