Barcelona lost ground on arch rivals Real Madrid in the Spanish title race after a deserved loss at Real Sociedad.
Needing victory to move level with Real, who won earlier in the day, Barca trailed when Alex Song headed into his own goal shortly after the half hour.
The visitors levelled within four minutes as Lionel Messi fired a precise 18-yard shot into the bottom corner.
Antoine Griezmann slid Sociedad ahead again after the break before turning provider for David Zurutuza to prod in.
It was a disappointing display by defending champions Barca, who started the weekend on top of La Liga with a superior goal difference over Real Madrid and Atletico Madrid.
Real Sociedad 3-1 Barcelona
But Real moved three points clear after a 3-0 home win against Elche earlier on Saturday which left the Catalans playing catch up.
Barcelona rested a host of key players following Tuesday's Champions League win at Manchester City, but the move did not pay off as Gerardo Martino's men produced a sloppy display which lacked fluency and any genuine attacking threat.
After a first-half display where his team dominated possession without creating the better opportunities, Martino's frustration boiled over at the interval and he was ordered to watch the second half from the stands by referee David Fernandez.

Barcelona's bogey team

Barcelona's defeat means they have not beaten Real Sociedad in San Sebastian in their last five attempts. The Catalans' last win there came in 2006-07, when goals from Andres Iniesta and Samuel Eto'o earned them a 2-0 win.
His side had gone behind when Cameroon midfielder Song, under pressure from Sociedad midfielder Gorka Elustondo, sent Sergio Canales's pinpoint right-wing cross flying past Barca keeper Victor Valdes.
The visitors were quickly level when Argentine superstar Messi deftly controlled a square pass before smashing his 25th goal of the season past home keeper Claudio Bravo.
But they were fortunate not to already be further behind after former Arsenal striker Carlos Vela missed a host of chances for the Basque side.
If Martino was already unhappy, then his mood further darkened as Sociedad took control in the space of five minutes before the hour mark.
Real Sociedad 3-1 Barcelona
After a high tempo start to the second half, the hosts deservedly regained the lead when Vela pounced on a stray header before squaring to Griezmann for his 15th goal of the season.
The France Under-21 winger then picked out Zurutuza, who was allowed a free run into the Barca area from deep before bravely poking past the onrushing Valdes.
Barca rarely threatened to produce a dramatic fightback as Sociedad, who have not been beaten in the Catalans' last five visits to San Sebastian, moved up to fifth.
Atletico could also move three points clear of Barca, with 13 games remaining, if they manage to beat Osasuna on Sunday.

LINEUP, BOOKINGS (5) & SUBSTITUTIONS (5)

Real Sociedad

  • 01 Bravo
  • 31 Zaldúa
  • 20 José Ángel Booked
  • 04 Elustondo (Rubén Pardo - 92' )
  • 03 González
  • 06 Iñigo Martínez
  • 17 Zurutuza
  • 05 Bergara
  • 11 Vela
  • 16 Canales Booked (Ansotegi - 84' )
  • 07 Griezmann (Xabi Prieto - 74' )

Substitutes

  • 02 Martínez
  • 08 Seferovic
  • 10 Xabi Prieto
  • 13 Zubikarai
  • 14 Rubén Pardo
  • 15 Ansotegi
  • 23 Javi Ros

Barcelona

  • 01 Valdés
  • 02 Montoya (Sánchez - 73' )
  • 21 Adriano
  • 17 Song (Fábregas - 61' )
  • 15 Bartra Booked
  • 03 Piqué Booked
  • 16 Busquets Booked
  • 08 Iniesta
  • 10 Messi
  • 07 Pedro
  • 11 Neymar

Substitutes

  • 04 Fábregas
  • 06 Xavi
  • 09 Sánchez
  • 13 Pinto Colorado
  • 14 Mascherano
  • 20 Tello
  • 22 Dani Alves
Ref: David Fernández Borbalán
Att: 30,485

MATCH STATS

Possession65%35%90minsReal SociedadBarcelona

Shots

1512

On target

33

Corners

213

Fouls

1315

Live Text Commentary

Full time
Full TimeMatch ends, Real Sociedad 3, Barcelona 1.
90:00+3:06Full time
Full TimeSecond Half ends, Real Sociedad 3, Barcelona 1.
90:00+2:07
Attempt missed. Andrés Iniesta (Barcelona) left footed shot from outside the box is too high. Assisted by Lionel Messi.
90:00+1:38Substitution
SubstitutionSubstitution, Real Sociedad. Rubén Pardo replaces Gorka Elustondo.
90:00+0:14
Attempt missed. Neymar (Barcelona) right footed shot from outside the box is close, but misses to the right. Assisted by Pedro.
88:27
Offside, Barcelona. Lionel Messi tries a through ball, but Pedro is caught offside.
88:26
Attempt blocked. Lionel Messi (Barcelona) left footed shot from the left side of the box is blocked.
88:08
Corner, Barcelona. Conceded by Mikel González.
88:06
Attempt blocked. Neymar (Barcelona) right footed shot from the centre of the box is blocked. Assisted by Francesc Fábregas.
86:31
Marc Bartra (Barcelona) wins a free kick in the attacking half.
86:31
Foul by Carlos Vela (Real Sociedad).
85:09
Foul by Gerard Piqué (Barcelona).
85:09
Xabi Prieto (Real Sociedad) wins a free kick in the attacking half.
83:55Substitution
SubstitutionSubstitution, Real Sociedad. Ion Ansotegi replaces Sergio Canales.
80:44
Gerard Piqué (Barcelona) wins a free kick in the defensive half.
80:44
Dangerous play by Carlos Vela (Real Sociedad).
80:26
Attempt blocked. Sergio Canales (Real Sociedad) left footed shot from the centre of the box is blocked. Assisted by Xabi Prieto.
80:22
Attempt blocked. Carlos Vela (Real Sociedad) right footed shot from the centre of the box is blocked.
80:12
Carlos Vela (Real Sociedad) hits the left post with a left footed shot from the centre of the box. Assisted by Xabi Prieto.
78:35
Gerard Piqué (Barcelona) wins a free kick in the defensive half.