Sporting Gijon clinched survival on the final day of the Liga season as Getafe and Rayo Vallecano dropped into the Segunda.
Getafe started Sunday outside of the bottom three but fell into the relegation zone courtesy of a 2-1 defeat at Real Betis, while Sporting's surprise 2-0 home win over fourth-placed Villarreal ensured their safety.
Rayo also emerged victorious, but a 3-1 beating of bottom club Levante was in vain for Paco Jemez's men, who finished a point behind Sporting in 18th.
Sporting took the lead after just eight minutes, striker Jony converting from Carlos Carmona's cross.
And 11 minutes from time Sergio Alvarez made sure of the points in spectacular fashion, scoring only his second La Liga goal – his first coming in last weekend's draw with Getafe – as he fired in off the crossbar from the edge of the area with a fierce strike.
Meanwhile, German Pezzella's header and a penalty from Ruben Castro put Betis 2-0 to the good against Getafe, who then saw Emi sent off for a foul on Dani Ceballos before Alvaro Medran netted what proved to be a scant consolation six minutes from time.
Goals from Pablo Hernandez, Jozabed and Miku helped Rayo to a 3-1 win over Levante that ultimately proved immaterial.
Afterwards, the defiant Rayo fans raised a banner which read "Never fear a sudden sinking. From a sunken boat comes a submarine".
Earlier, Malaga cruised to a 4-1 win over Las Palmas to seal eighth place.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.