This paper reports a bioclimatic envelope model study of the potential distribution of 19 tree species in the Iberian Peninsula during the Last Glacial Maximum (LGM; 21 000 yr BP) and the Mid‐Holocene (6000 yr BP). Current patterns of tree species richness and distributions are believed to have been strongly influenced by the climate during these periods. The modelling employed novel machine learning techniques, and its accuracy was evaluated using a threshold‐independent method. Two atmospheric general circulation models, UGAMP and ECHAM3 (generated by the Palaeoclimate Modelling Intercomparison Project, PMIP), were used to provide climate scenarios under which the distributions of the 19 tree species were modelled. The results obtained for these scenarios were assessed by agreement measure analysis; they differed significantly for the LGM, but were more similar for the Mid‐Holocene.The results for the LGM support the inferred importance of pines in the Iberian Peninsula at this time, and the presence of evergreen Quercus in the south. Important differences in the altitude at which the modelled species grew were also predicted. During the LGM, some normally higher mountain species potentially became re‐established in the foothills of the Pyrenees. The warm Mid‐Holocene climate is clearly reflected in the predicted expansion of broad‐leaved forests during this period, including the colonization of the northern part of the Iberian Peninsula by evergreen Quercus species.