Madrid, whose 40-game unbeaten run was ended by Sevilla on Sunday, fell behind when ex-Liverpool forward Iago Aspas drilled in his 16th goal of the season.
Zinedine Zidane was left annoyed by Real Madrid’s performance.
Madrid was thrashed 2-1 by Celta Vigo in the Copa del Rey quarter final first leg.
Spain striker Iago Aspas, the top-scoring Spaniard in La Liga, gave visitors Celta Vigo a shock lead in the 64th minute by pouncing on a misjudged back-heeled clearance from Marcelo.
Brazilian Marcelo made amends with a volley into the Celta net five minutes later but La Liga leaders Real were caught out again almost instantly on the counter-attack.
It means the visitors, who are eighth in La Liga, take a slender lead back to Galicia for next Wednesday’s return leg.
Zinedine Zidane’s side only lost twice in their previous 48 matches across all competitions.