Mountains imply enormous environmental variation, with alpine habitats entailing harsh environments, especially for ectotherms such as lizards. This environmental variability also may imply variation in prey availability. However, little is known about how lizard trophic ecology varies with elevation. In this study, we analyze diet, prey availability, prey selection, and trophic niche width in the lacertid lizard Psammodromus algirus along a 2,200-m elevational gradient in the Sierra Nevada (SE Spain). The analysis of fecal samples has shown that Orthoptera, Formicidae, Hemiptera, Coleoptera, and Araneae are the main prey, although, according to their abundance in pitfall traps, Formicidae and Coleoptera are rejected by the lizard whereas Orthoptera, Hemiptera, and Araneae are preferred. Prey abundance and diversity increase with elevation and diet subtly varies along with the elevational gradient. The consumption of Coleoptera increases with elevation probably as a consequence of the lizard foraging more in open areas while basking. The electivity for Araneae increases with elevation. Araneae are rejected in the lowlands—where they are relatively abundant—whereas, at high elevation, this lizard positively selects them, despite they being less abundant. The lizard trophic niche width expands with elevation due to concomitant greater prey diversity and hence this lizard feeds on more prey types in highlands. Although no sex difference in diet has been found, the trophic niche is broader in females than males. As a whole, alpine lizards show a trophic niche similar to that found at lower elevations, suggesting that P. algirus is well adapted to the harsh environment found in alpine areas.