Cristiano Ronaldo was sent off for lashing out but Gareth Bale scored a late penalty to give a ragged Real Madrid side all three points from a 2-1 win at Cordoba.
The European champions fell behind to a penalty scored by Nabil Ghilas in only the second minute of the game but Karim Benzema levelled later on in the first half.
Cordoba had a number of chances to retake the lead in the second half but wasted them all, and Bale snatched the winner from 12 yards in the 88th minute after his free-kick was handled by Fede Cartabia, who was also sent off.

Lionel Messi and Neymar each scored braces as Barcelona eviscerated struggling Elche 6-0 to keep the pressure on leaders Real.
The Catalans needed 36 minutes to break the deadlock through Gerard Pique but dominated the second half, particularly after Elche midfielder Faycal Fajr was sent off in the 57th minute.
Neymar and Messi then set about ravaging their opponents, while Pedro scored the final goal of the game in injury time.
This is the last time the two sides will face each other this season and Elche must be relieved to see the back of the Blaugranas, having conceded a total of 18 goals and scoring none in the four times they have met.

Atletico Madrid kept pace with their rivals at the top of the Primera Division as they brushed aside neighbours Rayo Vallecano 3-1.
Antoine Griezmann scored a brace - and somehow missed out on a hat-trick despite a string of second-half chances - and, although Roberto Trashorras pulled one back before half-time, an own goal from Alberto Manucho put Atletico back in firm control early in the second half.