We determined the environmental correlates of vascular plant biodiversity in the Baetic-Rifan region, a plant biodiversity hotspot in the western Mediterranean. A catalog of the whole flora of Andalusia and northern Morocco, the region that includes most of the Baetic-Rifan complex, was compiled using recent comprehensive floristic catalogs. Hierarchical cluster analysis (HCA) and detrended correspondence analysis (DCA) of the different ecoregions of Andalusia and northern Morocco were conducted to determine their floristic affinities. Diversity patterns were studied further by focusing on regional endemic taxa. Endemic and nonendemic alpha diversities were regressed to several environmental variables. Finally, semi-partial regressions on distance matrices were conducted to extract the respective contributions of climatic, altitudinal, lithological, and geographical distance matrices to beta diversity in endemic and nonendemic taxa. We found that West Rifan plant assemblages had more similarities with Andalusian ecoregions than with other nearby northern Morocco ecoregions. The endemic alpha diversity was explained relatively well by the environmental variables related to summer drought and extreme temperature values. Of all the variables, geographical distance contributed by far the most to spatial turnover in species diversity in the Baetic-Rifan hotspot. In the Baetic range, climate was the most significant driver of nonendemic species beta diversity, while lithology and climate were the main drivers of endemic beta diversity. Despite the fact that Andalusia and northern Morocco are presently separated by the Atlantic Ocean and the Mediterranean Sea, the Baetic and Rifan mountain ranges have many floristic similarities – especially in their western ranges – due to past migration of species across the Strait of Gibraltar. Climatic variables could be shaping the spatial distribution of endemic species richness throughout the Baetic-Rifan hotspot. Determinants of spatial turnover in biodiversity in the Baetic-Rifan hotspot vary in importance between endemic and nonendemic species.