BARCELONA- A late goal from substitute Jese helped Real Madrid beat Valencia 3-2 on Sunday but they remained five points adrift of leaders Barcelona who came from behind to overcome Getafe 5-2 thanks to a quickfire hat-trick from Pedro.
Real started sluggishly against a Valencia side who had interim coach Nico Estevez in charge following the sacking of Miroslav Djukic last week.
Valencia defended well and it needed a moment of quality from Angel Di Maria to break the deadlock just before the half-hour mark with a whipped shot which nestled in the corner.
Real dropped two points against Osasuna last weekend as they struggled to deal with crosses and they were again undone by headers, the first from Pablo Piatti to equalise.
Cristiano Ronaldo restored Real's advantage before the break but Jeremy Mathieu headed home a corner just after the hour mark.
Valencia looked capable of getting the winner until Jese scored eight minutes from time.
Earlier, the signs looked ominous for Barcelona as they went 2-0 down within the first 15 minutes after Sergio Escudero and Lisandro Lopez found the net for Getafe.
With Lionel Messi and Neymar missing through injury and suspension, Pedro took it upon himself to rescue Barcelona with three goals in eight blistering minutes.
The Canary Islander chipped keeper Miguel Moya and added two clinical finishes before the break.
He also crossed for Cesc Fabregas to volley in the fourth midway through the second half, and was then fouled in the box before Fabregas converted the penalty.
The battling spirit of Gerardo Martino's side, who were also missing senior players Xavi Hernandez, Victor Valdes and Carles Puyol, shone through as they refused to cave in despite trailing for much of the first half. "We had 15 bad minutes before the team rediscovered their composure and played how we had planned," Martino told a news conference.
"We got the result we wanted and it was a good game. It was a fantastic performance from Pedro and the whole team played well overall."
Barcelona top the table on 46 points, level with Atletico Madrid, who beat Levante on Saturday, but with a healthier goal record. Real are third on 41 points. "We dropped our level at times during the game but we need to concentrate on continuing to pick up points and starting the fight again in the New Year," said Real defender Sergio Ramos.
"There are areas that we need to work on which we will do. Barcelona and Atletico are making it difficult at the top but we will keep going."
Getafe took the lead against Barca after 10 minutes when a flick from Angel Lafita sent Escudero scampering clear and he beat keeper Jose Manuel Pinto unchallenged.
Minutes later Lopez was left unmarked at a corner and placed his header past Pinto.
Barca remained shaky at the back but began to show signs of improvement which led to Pedro pulling a goal back as he clipped the ball over Moya from the edge of the area.
Pedro then came in from the left and cracked a right foot shot into the top corner and completed his hat-trick, latching on to a pull-back by Jordi Alba, to slot in.
The goals continued to flow in the second half as Fabregas connected sweetly with a Pedro cross to score with a left-foot volley from close range and later beat the keeper with a penalty after Pedro was felled by Borja Fernandez.