Deportivo La Coruna face a nailbiting end to the season after losing at Malaga and missing the opportunity to secure survival.
Javier Saviola broke the deadlock right before half-time, while Julio Baptista doubled the lead early in the second half.
Diogo Salomao gave Depor hope of getting something from the match by scoring an unorthodox volley, but Isco made sure his and Manuel Pellegrini's final match at La Rosaleda ended well.
Fernando Vazquez's side remain one point above the relegation zone, the same position they were in at the start of the day, as their relegation rivals Real Zaragoza were thumped by Real Betis, but face a tough final match with Real Sociedad next weekend.
Malaga, meanwhile, are guaranteed to finish in the top seven in the Primera Division, but will not find out if they are able to compete in the Europa League until June 4, when the Court of Arbitration for Sport delivers its verdict on
whether the club's UEFA ban will be lifted or upheld.
Jesus Gamez prevented Juan Carlos Valeron from giving Depor an early lead by sticking a leg out at the back post to stop the midfielder's shot from going in.
Baptista and Joaquin missed good chances in quick succession for Malaga, while Juan Dominguez and Valeron came close to scoring at the other end.
With half-time approaching, Saviola appeared at the back post and stuck out a leg to volley in a cross from Joaquin and put Malaga ahead.
Riki was presented with the visitors' best chance of the game 10 minutes after the re-start when he found himself unmarked in the box, but hit his shot just wide of the post.
Baptista got the second goal on 64 minutes. The Brazilian played a one-two with Saviola then barged his way past Aythami Artiles in the area to poke the ball home.
With 15 minutes remaining Salomao volleyed a cross from Bruno Gama into the ground, which bounced over Malaga's defenders and high into the net.
But Isco, who is expected to leave Malaga in the summer, bade farewell to the club's home fans by securing the victory.
The 21-year-old received the ball from Joaquin just inside the area, turned Aythami and then slammed his shot off the crossbar and into the net.