Malaga temporarily reclaimed fourth spot in the Primera Division table with a 3-1 victory at Rayo Vallecano.
Weligton gave Manuel Pellegrini's side the lead but Piti levelled for the hosts from the penalty spot.
Former Real Madrid forward Julio Baptista scored his first goal in 18 months to restore Malaga's lead early in the second half before Pedro Morales secured all three points with a wonderful goal.
Malaga fielded a surprisingly strong line-up considering they play Borussia Dortmund in a Champions League quarter-final on Wednesday, but Morales, who joined the club on loan from Dinamo Zagreb in January, was given his first start.
And the Chilean certainly impressed on his full debut, providing the assists for Malaga's first two goals and then scoring himself.
Rayo Vallecano began the game brightly but it was the visitors who took the lead with only their second attempt of the game.
Morales swung a free-kick into the area and centre-back Weligton was unmarked at the far post to head the ball into the net with ease.
Rayo drew level with 30 minutes gone.
Right-back Tito moved forward to help the attack and made a perfectly-timed run which allowed him to beat the Malaga backline to a cross and find himself face to face with Willy Caballero.
He took the ball wide of the goalkeeper but was brought down by the Argentinian to earn a penalty, which captain Piti slammed home to equalise.
Jose Carlos missed a glorious chance to give Rayo the lead shortly before half-time as he aimed a free header wide of the near post from Jose Manuel Casado's perfect cross.
A magnificent through ball from Jose Carlos then presented Lass with a chance to give Rayo the lead on the break but the young forward's shot was saved by Caballero, and he could only hit the side netting with the rebound.
Malaga restored their lead 10 minutes after the restart.
Morales again delivered a fine cross, this time from a corner, and Baptista rose above the defence to head home his first goal since October 2011.
Rayo's heads appeared to drop after that goal and Malaga began to impose themselves on the match for the first time, while Rayo's earlier creativity began to fizzle out,
Baptista was presented with an easy chance to extend his side's advantage but, despite receiving a cut back from Joaquin from 12 yards out, he sent his shot well wide of the goal.
The Brazilian was replaced by Roque Santa Cruz, who almost scored immediately after coming on by getting on the end of another good cross by Morales only to poke the ball wide.
Caballero then denied Lass again, stretching to palm away a low shot that was destined for the bottom corner.
Morales then wrapped the points up with a superb finish to cap a marvellous debut.
It was Malaga's first win in five matches and a boost to their European ambitions but Rayo remain in ninth.