Real Sociedad took a huge step towards qualifying for the UEFA Champions League next season as they came from behind to beat Valencia 4-2 at Anoeta. Roberto Soldado had headed the visitors into an early lead but Inigo Martinez levelled with a sweet volleyed finish 11 minutes before the break.
Chori Castro then finished off a wonderful counter-attack to give Sociedad the lead on 73 minutes and Imanol Agirretxe looked to have sealed the points four minutes from time. Jonas momentarily put the outcome back in doubt as he halved the deficit but Agirretxe rounded off the scoring with a beautiful chip over Diego Alves in the last action of the game.
The win moves Sociedad five points clear of both Valencia and Malaga in fourth place with just five games remaining.
However, it had been Valencia who got off to the best possible start with a wonderfully worked goal on 25 minutes as Soldado showed great movement to get on the end of Aly Cissokho's cross and flicked his header inside the far post.
Sociedad were soon level though as a well-worked corner on the left created space for Castro to cross and he picked out Martinez at the back post to volley home in style. Sociedad went in front 17 minutes from time thanks to a stunning counter-attack from a Valencia corner as Castro and Agirretxe exchanged passes on two occasions before the former slotted neatly past Diego Alves.
Sociedad complete crucial win
The Brazilian keeper then kept his side in it with fine saves from Vela and Agirretxe. However, he was beaten again four minutes from the end as Agirretxe turned home Xabi Prieto's cross.
Jonas pulled one back with a header from close range as the game entered stoppage time after Bravo could only parry Pablo Piatti's effort. But the home fans' nerves were eased moments later as Agirretxe produced another stunning finish to move Montanier's men to within touching distance of a first Champions League campaign in ten years.
Elsewhere, Malaga moved level with Valencia in fifth with a routine 2-1 win over Getafe. Roque Santa Cruz and Weligton got the goals for the hosts just before and after half-time and despite Juan Valera's reply 20 minutes from time, Getafe's own European hopes are dwindling after a third consecutive defeat.
And in the clash between two sides stuck in mid-table mediocrity, Valladolid and Sevilla shared the points in a 1-1 draw. Javi Guerra put Valladolid ahead four minutes before half-time but Alvaro Negredo levelled from the spot just after the hour mark when Marc Valiente was harshly adjudged to have deliberately handled inside his own area.