Species range expansion reduces genetic variation at the margins of a species range and should thus compromise the adaptive potential of its marginal populations. Remarkably, this prediction has not previously been tested. Here, we show that populations of the plant Mercurialis annua, which expanded its range into Spain and Portugal from North Africa after the Pleistocene glaciation, respond to selection on a key life-history trait less well than populations from the species' historical refugium. Our results provide direct evidence of a decline in adaptive potential across the geographic range of a species after a shift in its distribution. Predicting evolutionary responses to environmental change will thus need to account for the genetic heterogeneity of species and the spatial dynamics of their geographic distributions.