The two-time reigning world player of the year was shown a straight red card in the 84th minute for kicking out at Cordoba defender Edimar.
Ronaldo, who could have been dismissed minutes earlier after punching defender Ivan Crespo only for the incident to go unnoticed by referee Alejandro Hernandez, took to Twitter after the match to say sorry.
He said: “I apologise to everyone and especially to Edimar for my thoughtless act in today’s game.”
Ronaldo’s sending-off could have cost Madrid dear, with the game locked at 1-1 and Cordoba having already wasted a number of chances to re-take the lead given to them by Nabil Ghilas’ second-minute penalty.
However, it was Madrid, having equalised through Karim Benzema in the first half, who would end up taking all three points thanks to Gareth Bale, who slotted home an 89th-minute penalty after his free-kick had been handled in the box.
Bale, whose goal was Madrid’s 100th in all competitions this season, said on his club’s website: “Cordoba have been a tough rival and we knew that this was going to be a tough ground, so we’re happy to have been able to recover in a very difficult game.”
Real’s win kept them one point clear of Barcelona and four clear of Atletico Madrid, both of whom also won on Saturday.
Bale added: “There’s a lot of the season left, a lot of games to go to talk about the title. What we’re clear about is that there can be games like this that can make things difficult for you.”
Regarding Ronaldo’s red card, the Wales international added: “Cristiano is very disappointed by his card but these are things that happen in football.”
Real coach Carlo Ancelotti, meanwhile, said in his post-match press conference that he had not seen the incident, telling reporters: “I didn’t see anything and I’ve not spoken with him. I can’t judge what happened.”