Real Madrid spurned the chance to go back above Barcelona at the top of La Liga as mid-table Levante inflicted their first league loss since October.
Barca, who visit Real next Sunday, went two points clear with a 5-0 win over Eibar earlier in the day.
But Real responded with a lacklustre display before Wednesday’s Champions League game with Manchester City.
The visitors missed a host of chances before Jose Luis Morales claimed a late winner with a superb volley.
Eden Hazard missed Real’s best chance midway through the second half before the Belgian forward hobbled off injured.
The Spanish giants were then stunned as Nikola Vukcevic played a speculative ball over their defence and winger Morales raced on to it before unleashing a first-time strike from the left side of the Real box.
Goalkeeper Thibaut Courtois actually pulled his hands away from the ball as Morales’ shot flashed past the Belgian at his near post.
The long-serving Levante captain, 32, was then substituted immediately after scoring just his second goal of the season and his team-mates survived some late pressure by Real to earn just their second win in seven league games.
Gareth Bale and fellow forward Luka Jovic were absent through illness, with Isco and Luka Modric the two changes for Real after last week’s 2-2 draw at home to Celta Vigo.
Isco and Karim Benzema were denied as Levante goalkeeper Aitor Fernandez made a double save early on before Casemiro headed wide after a poor punch clear by Fernandez.
Enis Bardhi tested Courtois as Real lost control of the game in the second half, before Morales broke the deadlock.
And the closest Real went to salvaging a point before Wednesday’s last-16 first leg (20:00 GMT) was when Sergio Ramos’ header was saved in stoppage time.