Real Zaragoza got the win they desperately needed to keep their survival hopes alive but they had to come from behind to see off Racing Santander 2-1.
Christian Fernandez headed in an early goal for the visitors which stunned the home crowd.
But Helder Postiga headed them level only two minutes later before a frustrating period where they piled on pressure for more than hour without reward.
Just when they feared time was beginning to running out, Angel Lafita finished from close range to snatch the points they needed to move level with 17th placed Rayo Vallecano.
Rayo hold the advantage in the head-to-head between the two so Zaragoza will still need to better their result on the final day, but the first part of their mission is complete.
Things got off to a terrible start for the hosts when Racing snatched an 11th minute lead, with Fernandez heading in from Jairo Samperio's free-kick after Papa Diop was brought down on the right wing.
But they managed to level just two minutes later as Pablo Alvarez served up a cross for Postiga to head home.
And from then on, it was Zaragoza who dominated the match.
Postiga's shot was held by Mario Fernandez, who then palmed away another effort from Adam Pinter from the edge of the area.
Lafita got into a dangerous area but his cross was blocked by Christian Fernandez at the expense of a corner, while Eduardo Oriol's shot was pushed around the post by the diving goalkeeper.
Lafita's effort from range was held by Mario Fernandez, and the goalkeeper then made a fine save to keep out his effort from an angle.
The hosts continued to pour forward in the second half.
Postiga lashed wide and then headed over in the opening five minutes after the break.
Ruben Micael's shot went wide right and Postiga was then off-target to the left before heading wide from an Antonio Apono free-kick.
There was no let up in the pressure and Lafita saw his header come back off the crossbar from Apono's free-kick on the hour mark, with Postiga then blazing over on the rebound.
After Lafita and Tomislav Dujmovic wasted further chances, Zaragoza were despairing of finding a breakthrough but it finally came in the 78th minute.
Fernandez made an outstanding save to deny Luis Garcia, but the forward picked up the pieces and crossed for Lafita to finish easily.
There was no let up as they sought a third, with Paulo Da Silva's header testing Fernandez before Alvarez blasted a shot over the top, but they had already done enough.