Real Betis left it late however preserved their Primera Liga status on Sunday afternoon with a 2-0 triumph at Racing Santander.
Edu scored twice in the last 10 minutes to enable the Seville-based club to remain up at the expense of Celta Vigo, whose 2-1 defeat of Getafe was not enough to grant them survival.
Real Sociedad joined Celta in the Segunda Division next season after a 3-3 draw at Valencia.
Rock-bottom Gimnastic Tarragona′s fate was sealed several weeks ago.
It looked bleak for Betis with Celta and Athletic Bilbao both winning entering the latter stages of their games.
It meant Betis also had to triumph and they managed it thanks to Brazilian forward Edu. He headed home the opener with 10 minutes to go and drilled home a 2nd in the closing stages.
Celta went into the final day 3rd from bottom however with genuine hope of staying up. It didn′t start well for Hristo Stoichkov′s men against Getafe, however, Pablo Redondo putting the visitors ahead.
But Habib Bamogo equalised and Matias Lequi then scored to hand Celta a triumph which ultimately proved futile.
Athletic were also in danger at the start of play, they were only a point ahead of Celta, however they saw off Levante 2-0 thanks to an own goal by Jose Manuel Serrano and an Igor Gabilondo header.
The odds were stacked against Sociedad even though they went out with a battling display at Champions League qualifiers Valencia.
Gaizka Garitano and David Villa exchanged early goals before a Victor Lopez own goal put Los Che in front.
Inigo Diaz de Cerio equalised only for a Mikel Alonso own goal to restore the hosts′ advantage.
But another own goal, this time from Emiliano Moretti, at least allowed Sociedad to depart with their heads held high.
Sunday afternoon′s other early game finished in a 3-1 triumph for Deportivo La Coruna at Espanyol.
The Primera Liga title will be decided later Sunday.
If Real Madrid beat Real Mallorca at the Bernabeu, then they will claim the crown for the 1st time since 2003. Should they lose defending champions FC Barcelona and Sevilla can snatch the trophy.
Barca visit Gimnastic whilst Sevilla host a Villarreal side chasing a UEFA Cup spot.