An injury-time strike from substitute Imanol Agirretxe condemned 10-man Barcelona to a 3-2 defeat at Real Sociedad, their first of a record-breaking La Liga season.
Lionel Messi matched another landmark by scoring in a 10th consecutive La Liga game to put Barca ahead after six minutes with Pedro Rodriguez doubling the lead yesterday.
But Chory Castro pulled a goal back before the break and then got his second after 63 minutes.
With Gerard Pique off the field after receiving a red card, Agirretxe got the winner in the 91st minute.
"I have to congratulate Real Sociedad and I have no complaints about my players. We hit the post twice in the first half and had two other chances. It became more
complicated for us and they made it 2-1," said Barca coach Tito Vilanova.
"I told Gerard (Pique) after he was booked that after the next foul he committed they would send him off and that's what happened. We were in control in the first half and although it looked difficult we were playing well. At 3-0 it would have been all over but the sending off changed everything."
There appears to be no record out of reach for Messi, who did score in 10 straight league matches that he was involved in during the 2011-12 season, notching up 18 goals in the process.
But now he has scored in Barca's last 10 and he equals the mark set by Ronaldo, who scored 12 in 10 games during the 1996-97 season, and Mariano Martin, who put away 18 in 10 matches between 1942 and 1943.
Messi has now hit 15 goals in 10 games and 29 overall in the league this season, but it counted for little on the night
Barca went into the game having set a new record for a La Liga start with 18 wins -- and just one draw against Real Madrid -- for 55 points from a possible 57.
Despite the loss, they are still 11 points ahead of Atletico Madrid, who play Levante on Sunday, and Real Madrid in third, who face Valencia, a huge 18 points off the pace.
Barca once again began with Andres Iniesta in attack alongside Messi and Pedro with Alexis Sanchez struggling for form and David Villa injured.
Real Sociedad played the more defensive Markel Bergara in midfield rather than Ruben Pardo but even so they were under threat right from the start with a ball over their backline from Iniesta that