Evidence of anthropogenic global climate change is accumulating, but its potential consequences for insect distributions have received little attention. We use a ‘climate response surface’ model to investigate distribution changes at the northern margin of the speckled wood butterfly, Pararge aegeria. We relate its current European distribution to a combination of three bioclimatic variables. We document that P. aegeria has expanded its northern margin substantially since 1940, that changes in this species' distribution over the past 100 years are likely to have been due to climate change, and that P. aegeria will have the potential to shift its range margin substantially northwards under predicted future climate change. At current rates of expansion, this species could potentially colonize all newly available climatically suitable habitat in the UK over the next 50 years or more. However, fragmentation of habitats can affect colonization, and we show that availability of habitat may be constraining range expansion of this species at its northern margin in the UK. These lag effects may be even more pronounced in less-mobile species inhabiting more fragmented landscapes, and highlight how habitat distribution will be crucial in predicting species' responses to future climate change.