Almeria 2-3 Valencia
Valencia struck back for a 3-2 victory to seal fourth spot in the Primera Division and condemn Almeria to relegation at the Juegos Mediterraneo on Saturday.
The home side went ahead through Thomas Partey to keep their slim hopes of survival alive before Nicolas Otamendi headed Valencia level.
Fernando Soriano restored Almeria's lead but Sofiane Feghouli and Paco Alcacer swung the match decisively Valencia's way.
The away side lost Dani Parejo to a second booking late on but held on to seal a spot in the Champions League play-offs, while Almeria dropped into the Segunda Division after finishing three points from safety.
The hosts took the lead with their first real chance of note within the opening 10 minutes as Atletico Madrid loanee Thomas fired home his fouth goal of the season.
The 21-year-old Ghanaian slotted home a free-kick, sending the set-piece into the bottom corner to hand his side a much-needed lead.
Almeria began to look for a second and 10 minutes later Jose Manuel Casado was unfortunate to see his left-footed shot from just outside the 18-yard box sail past the right-hand post.
The visitors came close to an equaliser midway through the first half but Rodrigo De Paul could not turn in Javi Fuego's cross.
Moments later the match was delayed slightly as Mauro sustained an injury and finally succumbed as he left the field of play to be replaced by Soriano just after the half-hour mark, by which time Valencia had levelled.
Argentinian winger De Paul provided the assist as compatriot Otamendi headed into the top corner from close range after 28 minutes.
The home side struck back eight minutes before the break, moments after Thievy Bifouma had his effort saved by Valencia goalkeeper Diego Alves, as substitute Soriano picked out the bottom-left corner of the net.
Shkodran Mustafi almost made it two for the visitors on the stroke of half-time, heading over, but his team-mate Feghouli - who spent part of 2011 on loan at Almeria - made no mistake in stoppage time as he tapped home Javi Fuego's corner to make it 2-2.
The second half began well for Valencia, who pressed to take the lead early on, but on-loan Manchester City striker Alvaro Negredo's header was blocked by home stopper Ruben.
The hosts had gone quiet now and Parejo was next to test Almeria just before the hour but Ruben kept out the midfielder's long-range effort, and after 65 minutes Michel Macedo was unlucky at the other end as he fired Jonathan's cross over the bar.
Ruben saved Paco Alcacer's close-range attempt to put the away side ahead moments later, while Alcacer's team-mate Alves was replaced by Yoel in the Valencia goal after 73 minutes due to an injury.
Both sides continued to press for a winner with Macedo close for the home side, but it was the visitors who got the fifth goal of the match with 21-year-old Spain international Alcacer on target as he sent Feghouli's cross into the bottom corner for his 17th goal of the season.
Valencia lost Parejo late on to a second yellow card for handball before Sebastian Dubarbier saw a last-gasp chance for an equaliser go wide, but the away side held on for all three points to seal the Champions League play-off spot.