Estimating species ability to adapt to environmental changes is crucial to understand their past and future response to climate change. The Mediterranean Basin has experienced remarkable climatic changes since the Miocene, which have greatly influenced the evolution of the Mediterranean flora. Here, we examine the evolutionary history and biogeographic patterns of two sedge sister species (Carex, Cyperaceae) restricted to the western Mediterranean Basin, but with Pliocene fossil record in central Europe. In particular, we estimated the evolution of climatic niches through time and its influence in lineage differentiation. We carried out a dated phylogenetic–phylogeographic study based on seven DNA regions (nDNA and ptDNA) and fingerprinting data (AFLPs), and modelled ecological niches and species distributions for the Pliocene, Pleistocene and present. Phylogenetic and divergence time analyses revealed that both species form a monophyletic lineage originated in the late Pliocene–early Pleistocene. We detected clear genetic differentiation between both species with distinct genetic clusters in disjunct areas, indicating the predominant role of geographic barriers limiting gene flow. We found a remarkable shift in the climatic requirements between Pliocene and extant populations, although the niche seems to have been relatively conserved since the Pleistocene split of both species. This study highlights how an integrative approach combining different data sources and analyses, including fossils, allows solid and robust inferences about the evolutionary history of a plant group since the Pliocene.