Zinedine Zidane’s side prevailed thanks to second-half goals from Ramos and Benzema to take top spot from the Catalans, courtesy of their superior head-to-head record in the two Clasico clashes this season.
The French coach handed a start to Vinicius Junior and the Brazilian could have scored inside two minutes as he fired over unmarked from a Fede Valverde cutback.
Chances were few and far between in the remainder of the first half and the 18-year-old’s final ball let him down on a number of occasions, but he provided the moment which brought the breakthrough early in the second half as he was adjudged to have been tripped by Diego Llorente in the area.
It looked harsh on the Real Sociedad defender and a soft decision, but was upheld by VAR and Ramos sent Alex Remiro the wrong way from the spot after 50 minutes.
The Madrid captain was hurt soon afterwards and went off with a knee injury, reappearing on the sidelines with heavy strapping which does not look great with Real in action again on Wednesday against Mallorca.
Substitute Adnan Januzaj livened up the home side’s attack as soon as he came on and thought he had levelled as he drove in a low shot from the edge of the box following a corner after 68 minutes, but the Hungarian’s effort was ruled out because Mikel Merino was in an offside position and was adjudged to have blocked the view of Thibaut Courtois.
Benzema then doubled Madrid’s lead in another controversial piece of play just two minutes later as he brought down a Valverde pass at the far post with what looked like his arm, before turning and firing a low effort past Remiro.
VAR had a look again as Benzema pointed to his shoulder and the goal stood as Madrid appeared to be heading to top spot.
But Merino slotted a shot home at the far post after 83 minutes, when Dani Carvajal was distracted by the presence of substitute Willian Jose.
That set up a nervy finale for Los Blancos, but Zidane’s side held on through six minutes of added time to seal top spot with eight games left.
Real Sociedad are now in sixth, five points off the Champions league positions after a draw and two losses since LaLiga’s return to action
Relive the action as it happened at Anoeta!
Can’t see the blog? Click here for the desktop version.