Match ends, Real Sociedad 1, Real Madrid 2.
Real Madrid went to the top of La Liga thanks to a hard-fought victory at Real Sociedad.
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.
Their sense of grievance grew when moments later Benzema controlled a Federico Valverde cross with his shoulder before firing home. The goal stood after a video assistant referee review for handball.
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.
The visitors' biggest problem from the game came when Ramos was injured soon after his goal and needed an ice pack on his leg in the stands.
Madrid - who have only won one La Liga title since 2012 - are now eight victories away from winning the league.
Barcelona host Athletic Bilbao on Tuesday with Real at home to Mallorca the next day (both 21:00 BST kick-offs).
- 18GorosabelBooked at 28minsSubstituted forElustondoat 60'minutes
- 3LlorenteBooked at 48mins
- 24Le Normand
- 5ZubeldiaBooked at 16minsSubstituted forZubimendiat 79'minutes
- 8MerinoBooked at 90mins
- 7Portugués Manzanera
- 21ØdegaardSubstituted forLópezat 79'minutes
- 10OyarzabalSubstituted forJanuzajat 60'minutes
- 19IsakSubstituted forDa Silvaat 79'minutes
- 9Da Silva
- 26Pacheco Dozagarat
- 4RamosSubstituted forMilitãoat 60'minutes
- 12MarceloSubstituted forMendyat 89'minutes
- 15ValverdeSubstituted forModricat 89'minutesBooked at 90mins
- 14CasemiroBooked at 21mins
- 16RodríguezSubstituted forAsensioat 78'minutes
- 9BenzemaSubstituted forMarianoat 78'minutes
- 25Vinícius Júnior
- 7E Hazard
- Xavier Estrada Fernández
- Shots on Target
Second Half ends, Real Sociedad 1, Real Madrid 2.
Mikel Merino (Real Sociedad) is shown the yellow card.
Hand ball by Nacho Monreal (Real Sociedad).
Luka Modric (Real Madrid) is shown the yellow card.
Mikel Merino (Real Sociedad) wins a free kick in the defensive half.
Foul by Luka Modric (Real Madrid).
Attempt missed. Aritz Elustondo (Real Sociedad) header from the right side of the box is close, but misses to the right. Assisted by Mikel Merino with a cross.
Adnan Januzaj (Real Sociedad) wins a free kick in the defensive half.
Foul by Luka Modric (Real Madrid).
Attempt missed. Mariano (Real Madrid) right footed shot from outside the box is too high. Assisted by Raphael Varane following a fast break.
Dangerous play by Marco Asensio (Real Madrid).
Nacho Monreal (Real Sociedad) wins a free kick in the defensive half.
Substitution, Real Madrid. Ferland Mendy replaces Marcelo.
Substitution, Real Madrid. Luka Modric replaces Federico Valverde.
Marco Asensio (Real Madrid) wins a free kick in the defensive half.
Foul by Martín Zubimendi (Real Sociedad).
Foul by Casemiro (Real Madrid).
Mikel Merino (Real Sociedad) wins a free kick in the attacking half.
Foul by Eder Militão (Real Madrid).