Racing Santander came back from the dead to turn a two-goal deficit into a 3-2 win and relegate nine-man Real Murcia at the Estadio El Sardinero.
Murcia looked as if they had given their slim chances of avoiding the drop a boost by roaring into a 2-0 lead inside half an hour, with Daniel Aquino and Ivan Alonso on the scoresheet.
A reply from Pedro Munitis gave the home side hope, before Jorge Lopez equalised.
Munitis' second goal proved to be the decider, with Murcia ending the match with nine men after Christophe Pignol and Alvaro Meija saw red.
Defeat for Murcia ends their one-season stay in the top flight. Santander remain fifth, two points behind Atletico Madrid who occupy the final Champions League spot.
Santander fans had only seen their side concede 13 goals at home before Sunday, but they were two down within 28 minutes.
It took 13 minutes for them to fall behind. Francisco Pena's cross into the box was choice and Aquino headed past goalkeeper Antonio Tono.
After the 28th minute it was looking good for Murcia, as Mateu Jofre played in Alonso from the left and the striker powered his strike beat Tono.
Santander replied eight minutes later as Mohamed Tchite crossed for Munitis, whose left-footed finish beat Fabian Carini.
The home side came out all guns blazing in the second half in search of an equaliser and it took them just two minutes to draw level.
Aldo Duscher's pass from the right played in Lopez, whose low strike from 20 yards beat Carini.
And the turnaround was complete nine minutes later, with Lopez the provider this time.
He fed Munitis who finished past Carini from 12 yards with the strike which relegated Murcia.
The visitors battled for an equaliser but were not helped by a double sending-off in the 81st minute.
First Meija was dismissed for his second bookable offence and play had barely restarted before Pignol joined him for a professional foul.
That left Murcia stretched to the limit and, as the clock ran down, they could not find a way back.