Climate change is expected to alter many natural ecosystems around the world, by affecting plants growth and distribution. This is particularly emphasized for several Mediterranean plant species and communities. In this study, we investigate the suitable habitat and geographical distribution of a remarkable Mediterranean tree, Ceratonia siliqua L. (Leguminosae), in Morocco. We hypothesized a reduction in the carob tree suitable habitats under climate change scenarios. To this end, we applied the maximum entropy algorithm (Maxent) to generate current and future models using 303 occurrence points coupled with 19 bioclimatic variables. Two representative concentration pathways (RCP4.5 and RCP8.5) by 2050 and 2070 were considered as future input scenarios. The maximum entropy model provides satisfactory results, with a high value of the Area Under Curve equal to 0.987 (±0.001). Jackknife tests indicate that precipitation followed by temperature play a significant role in the biogeographical dynamics of the Moroccan carob tree. Thus, the obtained results confirm our hypothesis of a reduction of the suitable area under the projected climate change scenarios by 2050 and 2070. The approaches developed in this study is promising to predict the potential distribution of native Mediterranean species and can be an effective tool to support conservation and restoration programs.