Madrid: Goalkeeper Iker Casillas came off the bench for 10-man Real Madrid who needed a second half double from Cristiano Ronaldo to beat Real Sociedad 4-3 while leaders Barcelona cruised to a 4-0 win over Espanyol. (Agencies)
Barcelona, whose goals on Sunday came in the first-half against their city neighbours, remain 16 points clear of their bitter rivals and 12 ahead of second-place Atletico Madrid.
Madrid captain Casillas was left out for the second consecutive game but was called upon after just five minutes following a penalty conceded by his replacement Adan Garrido who was red carded.
Xabi Prieto, who was to grab a hat-trick, scored from the spot-kick to equalise after Karim Benzema had put Madrid ahead in the second minute with Sami Khedira then restoring the lead for Jose Mourinho's side after 35 minutes.
Prieto struck again before half-time before Ronaldo came to the rescue with a brace after the restart.
Prieto hit his third with 14 minutes to go but Sociedad also finished with 10 men as Daniel Estrada was given a second yellow card.
After the game Mourinho said he was unconcerned about receiving abuse from the crowd.
"Perfect. Let them whistle me before the match and then support the team as they are doing. I think the whistles are for leaving Casillas out and also because we are not achieving our aims in the championship," he said.
"There are others who didn't applaud and are not happy with his (Casillas') performances. If I am not doing well it is normal that they whistle and it is something you have to live with. I don't want to be a hero independently of my performances."
Madrid faced an injury crisis at the back with Pepe, Fabio Coentrao, Marcelo and Raul Albiol all injured and Sergio Ramos suspended.
They got the perfect start with Khedira finding Benzema in space in the centre of the penalty area and he found the corner with a clinical finish.
But if the Bernabeu crowd were expecting to then see a comfortable victory after such an inconsistent season they were badly mistaken as only three minutes later Adan conceded the penalty for the visitors to draw level.
Adan's poor pass to Ricardo Carvalho went to Carlos Vela who bore down on goal and was upended by the shot-stopper. The referee pointed to the spot and also dismissed Adan which meant Casillas would play after all.
The player nicknamed 'Saint Iker' by Spain fans for his exploits in the recent successes of the national side was unable to make the perfect start as Prieto fired home the penalty.
Madrid went back ahead with Khedira flicking in a shot by Carvalho from the edge of the area but they were never comfortable at the back and Prieto got his second when a Vela strike fell to him and he drove the ball past Casillas.
After the break the game hit a lull before Ronaldo responded with a double.
Benzema hit a ball over the top and he finished clinically and then a couple of minutes later he struck a free-kick into the top corner.
Madrid: Goalkeeper Iker Casillas came off the bench for 10-man Real Madrid who needed a second half double from Cristiano Ronaldo to beat Real Sociedad 4-3 while leaders Barcelona cruised to a 4-0 win over Espanyol.