Swede Williot Swedberg scored both goals for the winners.
Shortly after his first goal, Fran Garcia was sent off for a second booking in the 53rd minute.
That was not enough – at the start of added time, Alvaro Carreras also received a red card for unsportsmanlike conduct.
With nine remaining, Real missed the second goal in the 93rd minute.
After this defeat, Xabi Alonso’s men are already four points behind leaders Barcelona.
Interestingly, they can still be pushed out of second place by Villarreal, who are only a point behind but still have a game in hand.
