Real Madrid narrowly escaped from Cordoba with three points as Gareth Bale converted from the penalty spot with just a minute left to play.
Cordoba went ahead just three minutes into the match, as Nabil Ghilas capitalized on a penalty kick of his own after Sergio Ramos handled the ball in the box.
[ RELATED: Latest La Liga standings ]
Down 1-0 to a team 30 points behind on the table, Real tied the score when Karim Benzema finished one of Madrid’s few chances in the first half.
Madrid was forced to ten men in the 82nd minute after Cristiano Ronaldo was shown a straight red card after an altercation with Brazilian defender Edimar. The two became tangled near the goal after challenging for a ball, and it looked as if Ronaldo gave Edimar a shove to the face and a kick to the ankle, warranting an immediate ejection from referee Alejandro Hernandez.
[ RELATED: Real Madrid sign Brazilian midfielder Silva ]
Playing a man down it seemed as if Real would leave with a draw, but just minutes after Ronaldo’s dismissal, Fede Cartabia was shown a red of his own after another handball in the box. Gareth Bale stepped up to the spot in the 89th minute and buried the penalty, stealing three points for Real.
With the win, Real go four points clear of Barcelona at the top of La Liga.