Observing vegetation dynamics and determining optimum conditions for tree species are important for the long-term habitat conservation. In this study we evaluate the environmental drivers that may explain the development and geographic distribution of Pistacia atlantica Desf. (wild pistachio) in Northeastern Iran. The study uses seven machine learning models to predict the habitats of P. atlantica: multivariate adaptive regression splines (MARS), flexible discriminant analysis (FDA), boosted regression tree (BRT), maximum entropy (MaxEnt), random forest (RF), support vector machine (SVM), generalized linear model (GLM), and their ensembles (ESMs). In total, 1477 P. atlantica sites were identified, described and mapped. The most relevant determinants of the species habitat were included as 28 bioclimatic, topographic, edaphic, and geologic components. While all the models returned high accuracies, the ESMs achieved the highest AUC, TSS, and Kappa values, suggesting a good predictive performance. The most important parameters explaining the species habitat were found to be the mean diurnal temperature range, annual precipitation and slope. These results support the higher performance of ESMs to predict the spatial distribution of P. atlantica. In turn, this model may support species conservation and decision-making at the regional and national levels.