Real Sociedad fought back from a goal down to defeat FC Barcelona 2-1 in the Anoeta stadium last night.
Second half goals from Diego Ifran and Xabi Prieto overturned a first half goal from Thiago Alcantara to leave the Basque side close to mathematically avoiding relegation.
Barcelona are still eight points clear of Real Madrid at the top of the BBVA Primera Liga table and can still be champions next week if they win at home to Espanyol while Madrid fail to win away to Sevilla.
As Jose Mourinho had done with Real Madrid earlier in the day, Pep Guardiola rested key players ahead of the second leg of the Champions League on Tuesday.
Jose Pinto played in goal, while youngsters Andreu Fontas, Jeffren Suarez, Thiago Alcantara and Martin Montoya in his starting 11.
The sides kicked off in pouring rain, with the home side needing points to climb away from the relegation zone, while Barcelona know that a win would leave them needing just one point to confirm their third consecutive league title.
The Catalans started brightly with Messi shooting wide and Ibrahima Affelay forcing a save from home keeper Claudio Bravo.
Barca were forced into an early change when Montoya was forced off with what turned out to be a broken collarbone, to be replaced by Dani Alves.
Thiago opened the scoring with a touch of fortune after 28 minutes. Messi' s control for once let him down, but the youngster' s run took him onto the ball and he was able to lift the ball over Bravo.
The rest of the half saw Barca content to control the ball and deny the home side possession, but the second period kicked off with them looking to kill off the game and Jeffren saw Bravo make another save.
At the other end Pinto saved from Tamudo with his legs as Real Sociedad, cheered on by their fans, looked to get back into the game.
The goal came with 20 minutes remaining as Diego Ifran, who had just replaced Tamudo, was able to chip Pinto and level the scores following a pass from Antoine Griezmann.
Gabi Milito had the ball in the net six minutes later but his goal was ruled out for offside, when replays showed it to be a wrong decision. To add injury to insult Milito suffered a muscle injury in the action and had to be replaced by Sergio Busquets.
Real Sociedad took the lead from the penalty spot with 10 minutes remaining after Javier Mascherano caught David Zurutuza and Xabi Prieto kept his calm to beat Pinto, who got a hand on the ball.