Real Sociedad's hopes of qualifying for the Champions League for the first time in a decade were dealt a blow as they could only manage a 3-3 draw at home to Real Madrid on Sunday night.
Gonzalo Higuain and Jose Maria Callejon had given Jose Mourinho's men a 2-0 lead in his penultimate match in charge before a spirited fightback from Sociedad saw them level matters through Xabi Prieto and Antoine Griezmann.
Sami Khedira then put Madrid back in front 10 minutes from time, but Prieto struck again in stoppage time to at least give Sociedad a share of the spoils.
The Basques now trail Valencia by two points with just one game to play after Roberto Soldado's solitary goal was enough to earn them a 1-0 win over Granada.
Elsewhere, Barcelona kept up their charge towards 100 points with a 2-0 win at Espanyol thanks to goals in either half from Alexis Sanchez and Pedro.
And all three relegation places will go down to the final day with Deportivo la Coruna, Real Zaragoza, Celta Vigo and Mallorca all still fighting to avoid the drop.
Madrid were without the injured Cristiano Ronaldo, Sergio Ramos and Xabi Alonso in San Sebastian, but they were gifted the perfect start on six minutes when Mikel Gonzalez gifted possession to Higuain and he strolled through to slot home his 15th league goal of the season.
Imanol Agirretxe should have levelled moments later when he nipped in ahead of Ricardo Carvalho but spooned his attempted chip past Diego Lopez well over the bar.
Sociedad were then denied by a wonder save from Diego Lopez as he somehow turned Griezmann's header from point-blank range behind for a corner and Griezmann and Agirretxe somehow combined not to score between them just before the break as the former prodded the ball out of the reach of Agirretxe on the stretch when his teammate would have had a simple tap in at the back post.
The home side were then stunned when Madrid doubled their lead on 57 minutes when a wonderful teasing cross from Kaka was flicked in by Callejon.
However, Sociedad were given a lifeline just seven minutes later though when Khedira handled inside his own area and Prieto, who scored a hat-trick in Sociedad's 4-3 defeat to Madrid earlier in the season, comfortably slotted the ball into the bottom corner from the resulting penalty.
Griezmann then did finally get the goal his performance deserved when he prodded home Carlos Martinez's fine low cross 12 minutes from time.
Amazingly Madrid were immediately back in front when Mesut Ozil released Khedira to dink a neat finish over the advancing Claudio Bravo.
But there was on final twist as Preito struck again to give Sociedad hope of still claiming the fourth and final Champions League spot next weekend.
Relegation battle is on
Champions Barcelona meanwhile enjoyed a much easier afternoon at neighbours Espanyol as they cruised to a 2-0 win to move within three points of Madrid's record 100 point tally from last season.
The visitors went after 14 minutes thanks to a wonderful individual goal from Alexis Sanchez as he played a one-two with David Villa and cut inside before placing a right-footed shot into the far corner.
Cesc Fabregas then hit the post as the visitors continued to boss things and David Villa should have sealed the three points when he somehow fired wide just after the restart.
However, after Mubarak Wakaso had been sent-off for Espanyol, Pedro did make the game safe with a neat volleyed finish five minutes from time.
At the bottom Celta managed to keep themselves alive with a comfortable 2-0 win at Valladolid thanks to goals from Gustavo Cabral and Iago Aspas.
They are now level with Zaragoza who lost 4-0 at Real Betis on 34 points with Deportivo, who were also defeated 3-1 at Malaga, currently safe on 35 points.
And Mallorca also kept themselves alive for another weekend as they drew 0-0 at Atletico Madrid, however the Islanders are now bottom on 33 points.