Second-half goals from Arouna Kone, Xavi Torres and Valdo helped Levante return to the top four of the Primera Division with a 3-1 win over struggling Granada.
The visitors managed to frustrate Juan Ignacio Martinez's side throughout the first half, but their good work was undone within 30 seconds of the second as Kone headed home his 15th league goal of the season.
Having conceded, though, Granada opened up and they were level midway through the second half as Odion Ighalo forced home the rebound after Gustavo Munua parried Franco Jara's shot.
However, Torres restored Levante's lead five minutes later with a thumping finish at the end of a fine team move and Valdo headed home from close range with six minutes remaining to secure all three points.
Racing Santander's 10-year spell in the Primera Division is over after an Antoine Griezmann brace condemned them to a 3-0 defeat to Real Sociedad in San Sebastian.
Sociedad's win confirms their presence in the top flight next season and they had their French playmaker to thank as he scored twice in the second half to settle the match.
The 21-year-old was a constant thorn in Racing's side and added the finishing touch when he teed up Imanol Agirretxe for the third.
Raul Garcia struck a brilliant equaliser to keep Osasuna firmly in the hunt for a European place and deny relegation-threatened Villarreal an invaluable victory at El Madrigal.
Villarreal looked set to move six points clear of the drop zone after taking a 44th-minute lead through Bruno Soriano but the hosts paid the price for failing to make the most of several opportunities when Garcia found the top corner with a stunning volley 18 minutes from time to secure a 1-1 draw.
The result sees Osasuna join seventh-placed Atletico Madrid on 48 points and leaves Villarreal in the bottom four, four points above Sporting Gijon and the relegation zone.
Sporting Gijon produced a fine second-half performance to keep their survival hopes alive with a 3-0 victory away to Espanyol.
Neither side came close to a goal in an evenly-contested first half short on clear-cut chances, but the visitors took only two minutes to make the breakthrough after half-time as Adrian Colunga slotted below Cristian Alvarez from a narrow angle.
The hosts pushed forward in search for an equaliser, but only succeeded in leaving themselves open at the back. Twice they were caught out on the counter-attack as Sporting sealed the points with goals from Oscar Trejo and Mate Bilic in the final 20 minutes.
Sporting remained in the bottom three, but victory boosted their chances of beating the drop with three games to go.
Real Mallorca climbed above Getafe into the top 10 with a 3-1 victory at the Coliseum Alfonso Perez.
Goals from Victor Casadesus, Alejandro Alfaro and substitute Tomer Hemed put Mallorca in complete charge and Getafe could only manage a late consolation strike from Alexis.
The victory was Mallorca's third in their last four matches and kept alive their hopes of snatching a Europa League berth, but defeat was a blow to the European hopes of Getafe, who have now lost three of their last four.