Barcelona head into next week’s first El Clasico of the season six points behind leaders Real Madrid after scraping a draw at Real Sociedad.
The champions – who have now failed to win in their last eight games at Anoeta Stadium – were outplayed and had to come from behind to secure a point.
Willian Jose headed the hosts ahead, Gerard Pique helping the ball over the line while attempting a clearance.
The lead lasted six minutes, Lionel Messi scoring against the run of play.
La Real should have won the game when Juanmi tapped home a rebound from close range after Carlos Vela hit the crossbar, but the former Southampton forward, who had only been on the pitch for seconds, was wrongly ruled offside.
Former Arsenal forward Vela, 27, hit the woodwork for a second time when his 20-yard effort hit a post six minutes from time.
Luis Enrique’s visitiors had 47.7% possession, the first time this season they have had less of the ball than their opponents.
Barca, who have now failed to win their last two La Liga games, are second in the table on 27 points from 13 games – level on points with Sevilla.
Real Sociedad – who had won their previous four home games in the league against Barcelona – have 23 points and climb to fifth.
Barcelona host Zinedine Zidane’s side at the Nou Camp next Saturday (15:15 GMT)