Real Sociedad ended a run of four matches without a win in the Primera Division and moved out of the bottom three with a deserved 2-1 victory at Malaga .

Carlos Vela gave the visitors the lead in the opening minute and, although that was cancelled out by Javier Saviola, Xabi Prieto scored the decisive goal in the second half.

Defeat leaves Malaga in fifth place, 10 points behind leaders Barcelona.

The home side came into the match on the back of a successful midweek, which saw them qualify for the last 16 of the Champions League with a draw against AC Milan.

And they appeared to still have their minds on Europe when Vela fired Sociedad in front after just 46 seconds.

Diego Ifran picked up the ball on the left of the area before playing it across to the Mexican forward, who stabbed home left-footed.

The home side quickly woke up and responded with a header from Weligton which dipped over the crossbar.

Malaga goalkeeper Willy Caballero was then called into action to keep out a shot from Carlos Martinez, and it proved vital as the home side were level after 37 minutes.

A corner from the right from Joaquin fell to the feet of Saviola, with the former Argentina international steering the ball round a defender before smashing a half-volley into the top right corner.

Sociedad were back on the attack within minutes, though, and could have regained the lead before the interval had Mikel Gonzalez not put his header wide of the mark.

The visitors were just as determined in the second half and they silenced the home crowd once more after 59 minutes when Ruben Pardo's shot was deflected into the path of Prieto, who rounded the keeper before slotting home.

That left Malaga chasing the game for a second time and Isco tried to pull them level with a shot after 73 minutes, but it was saved somewhat fortuitously by the feet of Enaut Zubikarai before the goalkeeper quickly recovered to claim the ball.

However, it was Sociedad who came closest to scoring again when substitute Jose Angel smashed a shot from 25 yards which clipped the top of the bar on its way over.