Osasuna dealt a further blow to Barcelona’s Primera Division title hopes with a 3-2 success at the Estadio Reyno de Navarra.
Two goals from Dejan Lekic had the home side in control at half-time – but Alexis Sanchez pulled a goal back six minutes into the second half.
Raul Garcia made it 3-1 to the home side five minutes later but substitute Cristian Tello netted a second for Barcelona 17 minutes from the end.
There were several clear chances at both ends and a disallowed goal for the visitors – but Osasuna held on for victory to leave Barcelona still seven points adrift of leaders Real Madrid, who play Levante at home on Sunday.
It means Pep Guardiola’s men have now dropped 16 points on their travels in the Primera Division this season.
The home side were ahead in only the fifth minute when Lekic rolled in the opening goal, ending a neat spell of passing.
Lionel Messi saw an 11th-minute shot palmed over, but 11 minutes later the home side were two goals clear when Lekic got on the end of Alvaro Cejudo’s cross from the right to convert from close range.
Messi shot weakly at goalkeeper Andres Fernandez in the 28th minute and 10 minutes later saw a shot blocked.
But Barcelona were back in the contest six minutes into the second half when Sanchez converted Isaac Cuenca’s cross at the far post.
However, Osasuna restored their two-goal advantage five minutes later when Garcia poached a goal at the near post.
Substitute Tello kept Barcelona in the contest in the 73rd minute when he made it 3-2, cutting inside Francisco Nino and blasting past Fernandez with his left foot.
Francisco Punal struck the Barcelona post in the 78th minute and three minutes later Barca appeared to have equalised when Sanchez headed in from close range – but referee Jose Luis Paradas Romero ruled the effort out for offside, with Sergi Roberto adjudged to have glanced Messi’s ball on before the Chilean finished the move off.
Sanchez was denied by the onrushing Fernandez in the 89th minute – and the visitors’ final chance came and went in the fourth minute of stoppage time when Cesc Fabregas saw his close-range header, from Messi’s ball, easily saved by Fernandez.