FT. Real Sociedad 1-2 Real Madrid.
Zinedine Zidane’s side are level on points with Barca, who drew 0-0 with Sevilla on Friday but go top because of their superior head-to-head record.
Sergio Ramos’ penalty after the lively Vinicius Jr was fouled gave the visitors the lead.
Karim Benzema doubled their advantage before Mikel Merino’s strike set up a tense finale.
There was controversy when substitute Adnan Januzaj thought he had made it 1-1 with a strike from outside the area but it was ruled out for a Merino offside. Merino did not get a touch but the officials deemed he was blocking goalkeeper Thibaut Courtois’ view, so interfering with play.
Madrid looked comfortable at that stage but Merino rifled a shot in via the underside of the crossbar, after a cross from substitute Roberto Lopez, to keep the closing minutes interesting.
Madrid – who have only won one La Liga title since 2012 – are now eight victories away from winning the league.