In the present scenario of climatic change, climatic refugia will be of paramount importance for species persistence. Topography can generate a considerable climatic heterogeneity over short distances, which is often disregarded in macroclimatic predictive models. Here we investigate the role of rocky habitats as microclimatic refugia by combining two different analyses: exploring a thermal mechanism whereby rocky habitats might serve as refugia, and examining if the biogeographic pattern shows a high abundance of relict, endemic and peripheral species.The thermal profile of two populations of relict and endemic plant species occurring in Pyrenean cliffs was investigated by infrared images and in situ temperature data-loggers. Despite occurring in crevices of a south oriented slope, Androsace cylindrica showed a narrower daily range of temperature than the surrounding matrix, thereby avoiding extreme high temperatures. Borderea chouardii, of tropical ancestors, also occurred in patches where temperatures were buffered during the growth season, experiencing lower mean temperatures than the surrounding matrix and nearby areas during the warmer part of the day, and similar temperatures during the colder. The rocky habitats of both species, therefore, reduced temperature ranges and exposition to extreme climatic events. Compared to other habitats, the rocky ones also harboured a high fraction of both endemics and peripheral plant populations according to the largest vegetation dataset available in the Pyrenees (18,800 plant inventories and 400,000 records). Our results suggest an association between the habitats of relicts, endemics and species at their distribution limit, driven by a stabilizing effect of rocky habitats on extreme temperatures. Given the important role of rocky habitats as hotspots of singular and unique plants, their characterization seems a sensible first step to identify potential refugia in the context of climate change.