Real Madrid knocked Barcelona off the top of La Liga by beating Real Sociedad 2-1 on Sunday as Sergio Ramos rolled in another penalty before being forced off due to injury.

Karim Benzema continued his excellent form by adding a second at Anoeta and while Mikel Merino gave Real Sociedad hope with seven minutes left, Madrid held on to go above Barca on head-to-head.

Real Sociedad were contenders for the top four before the three-month suspension but a draw and two defeats since the restart leaves them sixth, five points adrift.

Ramos scored his 20th consecutive spot-kick in the 50th minute to become La Liga’s highest ever scoring defender on 68 goals, overtaking Ronald Koeman on the all-time list.

“He’s the best defender in the world,” said Zinedine Zidane. “What he has been doing and achieving for so many years is incredible.”

But Ramos limped off 10 minutes later with what looked like a knee injury, which will be a huge concern for Madrid if the problem proves serious. He was seen sitting with an ice-pack on his left knee in the stands.

“Right now it hurts a lot but that’s just the bang I think,” said Zidane afterwards. “That’s the good news but we’ll see.”

Madrid also benefitted from two tight decisions after Adnan Januzaj drove in an equaliser for Real Sociedad, only to have it ruled out before Benzema doubled the lead and was adjudged not to have controlled with his arm.

Both calls were close and the fact they fell for Madrid will not have gone unnoticed in Barcelona.

“From what we’ve seen it will be very difficult for Real Madrid to drop points,” said Barca defender Gerard Pique on Friday.

It was Barca’s failure to score at Sevilla that presented the opportunity to Madrid, whose victory in one of their toughest fixtures left has shifted the title race back in their favour.

Their defence, which boasts the club’s best record at this stage in 32 years, has been key.

Casemiro suspended

Casemiro is suspended after picking up a yellow card although Real Mallorca at home on Wednesday is the kind of fixture Madrid should be able to negotiate, even without Ramos and their only defensive midfielder.

Zinedine Zidane will at least hope to have Eden Hazard fresh again after the Belgian was named on the bench.

Gareth Bale was also among the substitutes not to be brought on. His replacement Vinicius Junior caused Andoni Gorosabel problems with his pace and it was the Brazilian who won the penalty, after nipping inside the defender before his right foot was caught by Diego Llorente.

Ramos made no mistake but seemed to take a bang on his knee shortly after and despite limping on for several minutes, was eventually replaced by Eder Militao.

His removal coincided with a surge from Real Sociedad, who thought they had equalised when Januzaj drove into the corner only for Merino to be ruled offside, seen to be close enough to Courtois to be interfering with the goalkeeper’s line of sight.

Real Sociedad’s sense of frustration was compounded when Benzema made it two.

Referee Javier Estrada again consulted VAR but this time allowed the goal to stand, believing Benzema to have controlled with his shoulder before firing in.

Merino set up a nervy finish with a thundering shot in off the crossbar but Madrid held on for an important win.

Guedes scores brilliant solo goal

Earlier, Goncalo Guedes scored a mesmerising solo goal as Valencia stayed in touch with the Champions League qualification places by beating Osasuna 2-0.

Guedes picked the ball up in his own half and surged past four Osasuna players before completing his stunning run with a driven shot into the top corner.

Rodrigo Moreno made it two at Mestalla as Valencia reduced the gap behind fourth-placed Sevilla to six points.

Osasuna drop to 12th and their next opponents will be Alaves, who suffered a crushing 6-0 defeat away at fellow strugglers Celta Vigo.

Alaves were reduced to 10 men after 27 minutes when Martin Aguirregabiria was sent off and Celta capitalised.