Protecting biodiversity against the impacts of climate change requires effective conservation strategies that safeguard species at risk of extinction. Microrefugia allowed populations to survive adverse climatic conditions in the past, but their potential to reduce extinction risk from anthropogenic warming is poorly understood, hindering our capacity to develop robust in situ measures to adapt conservation to climate change. Here, we show that microclimatic heterogeneity has strongly buffered species against regional extirpations linked to recent climate change. Using more than five million distribution records for 430 climate-threatened and range-declining species, population losses across England are found to be reduced in areas where topography generated greater variation in the microclimate. The buffering effect of topographic microclimates was strongest for those species adversely affected by warming and in areas that experienced the highest levels of warming: in such conditions, extirpation risk was reduced by 22% for plants and by 9% for insects. Our results indicate the critical role of topographic variation in creating microrefugia, and provide empirical evidence that microclimatic heterogeneity can substantially reduce extinction risk from climate change.