Valencia will go into the final day of the La Liga season in possession of the fourth and final Champions League position - but an injury time goal for Real Sociedad could yet prove vital.
Valencia beat Granada to move two points clear of Sociedad, who claimed a late draw at home to Real Madrid.
It means Real Sociedad must win at relegation-threatened Deportivo La Coruna next Saturday and hope Valencia fail to take maximum points away to Sevilla.
Valencia ground out a 1-0 victory over Granada, with Roberto Soldado's close-range finish just before the hour mark deciding the contest.
Real Sociedad twice came from behind to snatch a point in the final seconds but will still be left wondering how they surrendered the advantage in the Champions League race after dominating Real Madrid almost from start to finish before drawing 3-3.
Xabi Prieto's header in the third minute of stoppage time secured a point for Sociedad but it should have been three in a match that saw the home side create chance after chance, only to trail virtually throughout to a much-changed Madrid side who rarely let an opportunity pass them by.
Gonzalo Higuain pounced on a defensive mistake to put Madrid ahead five minutes in and after they withstood a barrage of Sociedad attacks, Jose Maria Callejon doubled the lead just before the hour mark.
Prieto got one back from the penalty spot before Antoine Griezmann levelled with 12 minutes left, but it seemed all that hard work was for nought when Sami Khedira restored Madrid's advantage seconds later.
Barcelona remain on course to match Real Madrid's 100-point record after comfortably beating local rivals Espanyol 2-0 away from home.
Tito Vilanova's side took the lead through a brilliant goal by Alexis Sanchez, while Pedro Rodriguez made sure of the win by adding a second after Espanyol had been reduced to 10 men thanks to Wakaso Mubarak's dismissal.
The champions will reach a century of points if they beat Malaga at the Nou Camp on the final day of the season, while Javier Aguirre's men waved goodbye to their already faint chances of qualifying for the Europa League.
Diego Castro's late own goal at Getafe kept Rayo Vallecano's Europa League dream alive with a 2-1 win but their battle for seventh place in the Primera Division could still be in vain.
Rayo came from behind to win the local derby at the Coliseum Alfonso Perez as Alejandro Dominguez cancelled out Rafa Lopez's opener before Castro put through his own net at the death.
Paco Jemez's men can depose Real Betis with victory over Athletic Bilbao on the final day, given their superior head-to-head record, but Rayo have been denied a European licence due to financial concerns.
While the Spanish Football Federation considers Rayo's appeal, the Madrid outfit must win once more while praying Betis slip up at Levante.
Osasuna ensured they will be playing Primera Division football again next season after fighting back from a goal down to defeat Sevilla 2-1 at the Reyno de Navarra.
Alvaro Negredo put European hopefuls Sevilla ahead just after half-time but Patxi Punal drew Osasuna level around the hour-mark and then substitute Alvaro Cejudo curled home a free-kick with 12 minutes remaining to earn the hosts all three points.
The victory, combined with defeats for relegation rivals Real Zaragoza and Deportivo La Coruna, means Osasuna are now five points above the drop zone with just one game remaining, ensuring they now cannot finish in the bottom three.
Deportivo La Coruna face a nailbiting end to the season after losing 3-1 at Malaga and missing the opportunity to secure survival.
Javier Saviola broke the deadlock right before half-time, while Julio Baptista doubled the lead early in the second half. Diogo Salomao gave Depor hope of getting something from the match by scoring an unorthodox volley, but Isco made sure his and Manuel Pellegrini's final match at La Rosaleda ended well.
Celta Vigo's fight for survival will go down to the final day after claiming an impressive 2-0 win on the road at Valladolid.
Gustavo Cabral opened the scoring in the first half before the highly-rated Iago Aspas doubled the advantage from the spot after the break.
The win sees Celta climb from the foot of the standings to third-bottom, a point behind Deportivo La Coruna, who are now the only side other than the current bottom three embroiled in the fight for survival.
Real Zaragoza slipped closer to the relegation trapdoor after a thumping 4-0 defeat at European hopefuls Real Betis.
Manolo Jimenez's men were torn apart in Seville and will go into the final day of the season next weekend at home to Atletico Madrid in 19th place, a point adrift of Deportivo La Coruna in 17th.
A win at Betis would have gone a long way to assuring them of a place among the elite next season but they never got started, falling behind inside 15 seconds to a Ruben Castro strike and they were two down when Dorlan Pabon netted after 17 minutes.
Jorge Molina added a third five minutes into the second half and Pabon completed a miserable night for Zaragoza 20 minutes from time.
Real Mallorca's hopes of avoiding relegation remain alive after they played out a 0-0 draw with Atletico Madrid, but results elsewhere mean they slipped back down to the bottom of the table.
The result means that Gregorio Manzano's side will have to beat Real Valladolid at home, and hope that their three relegation rivals - Deportivo La Coruna, Celta Vigo and Real Zaragoza, all lose their final games if they are to stay up.
Diego Simeone's side were not able to toast their celebrations with a victory, and could even have lost the game were it not for two great saves by Thibaut Courtois.
Athletic Bilbao waved goodbye to their 100-year old San Mames home in a most disappointing fashion, as Iker Muniain was sent off in a stoppage-time 1-0 defeat to Levante.
Juanlu volleyed in the only goal of the game from six yards out to claim victory for his side, who moved up to 11th in the Primera Division table, while Athletic slipped down to 13th and saw their faint hopes of claiming a Europa League spot vanish.