During geographical expansion of a species individual colonizers have to confront different ecological challenges, and the capacity of the species to broaden its range may depend on the total amount of adaptive genetic variation supplied by evolution. We set out to test whether the distribution of loci under selection along a contrasting environmental gradient can be turned into a model that accurately predicts a species' range. If positive, this may shed light on the genetic source of adaptive limits that shape range boundaries. We sampled five populations of the western Mediterranean lizard Psammodromus algirus that inhabit a noticeable environmental gradient of temperature and precipitation. We used 21 SNPs putatively under selection to correlate the genotypes of 95 individuals with environmental variation among their populations, using 1x1 km2 grid cells as sampling units. By extrapolating the resulting model to all possible combinations of alleles, we inferred the locations that were theoretically suitable for the species. The inferred distribution range overlapped to a large extent with the realized range of the species, including an accurate prediction of internal gaps and range borders. Our results suggest an adaptability threshold determined by the amount of genetic variation available that would be required to warrant adaptation beyond a certain limit of environmental variation. These results support the idea that the expansion of a species' range may be ultimately linked to the arising of new variants under selection.