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.