Madrid: Gareth Bale scored a late winner from the penalty spot after Cristiano Ronaldo had been sent off for the ninth time in his career as Real Madrid came from behind to beat Cordoba 2-1 on Saturday.
Barcelona remain just a point behind the European champions having played a game more as Neymar and Lionel Messi both scored twice in a 6-0 win at 10-man Elche.
Madrid got off to the worst possible start when Sergio Ramos handled inside his own area and Nabil Ghilas slotted home the resultant penalty.
Karim Benzema levelled from James Rodriguez`s corner midway through the first-half, but Ronaldo`s frustration at a poor performance seemed to have cost his side the chance of victory when he lashed out at Edimar seven minutes from time.
However, the numbers were levelled up when Fede Cartabia was shown a second yellow card for handling Bale`s free-kick inside the area, and in Ronaldo`s absence, the Welshman took responsibility from the spot to secure all three points.
"I apologise to everyone and especially to Edimar for my rash act in the game today," Ronaldo wrote on his official Twitter account.
"I haven`t seen it yet and I still haven`t spoken with him so I can`t judge," Madrid boss Carlo Ancelotti said of Ronaldo`s dismissal.
"We suffered in this game, but it is was important to get the three points and we managed to do it."
The enthusiasm generated by Madrid`s first visit in 44 years ensured there was a full house at the Nuevo Arcangel and the home fans had plenty to cheer within the first two minutes as Manchester United reject Bebe saw his shot cannon off Ramos`s arm and Ghils converted from the spot.
Slowly, though, Madrid began to find their feet and drew level on 27 minutes when Rodriguez`s corner was flicked on by Bale and Benzema slammed home his 15th goal of the season from close range.
However, Cordoba will rue not making the most of a host of opportunities to seal a famous win after the break.
Cartabia was desperately unlucky to see his shot from the edge of the area fly just wide before a scintillating run by Bebe took him past a host of Madrid defenders but his weak shot was easily held by Casillas.
The best chance of all fell to Florin Andone when he pounced on a poor header by Raphael Varane, but Casillas did just enough to turn his attempted lob on to the bar.
Ronaldo`s frustrations then boiled over when he was rightly dismissed for kicking out at Edimar.
Yet, Ancelotti`s men still managed to grind out a vital victory when Bale made no mistake from the spot after Cartabia clearly handled his initial free-kick.
It was a far more comfortable evening for Barcelona once Gerard Pique had chested down Xavi Hernadez`s free-kick to open the scoring 10 minutes before half-time.
A slick counter-attack 10 minutes after the break handed the visitors the chance to double their advantage when Neymar was scythed down by Sergio Pelegrin inside the area and, unlike when he missed from the spot against Atletico Madrid in midweek, Messi confidently slotted home the penalty.
Faycal Fajr was then shown a second yellow card to leave the hosts a man short in the final half hour.
And it showed as Messi teed up Neymar to sweep home the third and better was to come from the South American duo 19 minutes from time when Messi`s lofted pass was volleyed high into the net by the Brazilian for his 19th goal of the season.
Messi made it 5-0 with a classic left-footed finish into the bottom corner two minutes from time before Neymar squared for Pedro Rodriguez to round off the scoring in stoppage time.