Sevilla avoided a third consecutive defeat in La Liga and stopped high-flying Real Sociedad from going top after coming from behind to beat them 3-2 on Sunday.

After Real Madrid’s stalemate against Atletico on Saturday, the Basque outfit could have leapfrogged both to claim first place in Spain but came up short in a pulsating contest at the Ramon Sanchez Pizjuan.

It looked good for the visitors when Mikel Oyarzabal gave them a fourth-minute lead but Nolito equalised for Sevilla with a sumptuous half-volley before Lucas Ocampos and Franco Vazquez completed the comeback in the second half.

Portu still set up a nervy finish when he added a second for Real Sociedad in the 87th minute but Sevilla held on for a much-needed win, after consecutive losses to Real Madrid and Eibar this week.

After signing 12 new players in the summer, Sevilla have gelled impressively quickly and they now sit sixth, just two points off the top.

Their credentials for keeping pace with the leaders will be tested next weekend, when they play away at defending champions Barcelona.

Real Sociedad have been arguably the surprise side of the season so far, having already beaten Atletico Madrid and with Martin Odegaard, the 20-year-old on loan from Real Madrid, back in form.

They are fifth after seven games played, level on points with both Sevilla and Barca.

Sevilla were undone early as Adnan Januzaj won the ball back and freed Oyarzabal, who finished for his fourth goal of the season.

The lead barely lasted even quarter of an hour though as Julen Lopetegui’s side hit back with a brilliant goal of their own. Ever Banega’s superb pass picked out Nolito at the back post and he took the ball on the half-volley, guiding it inside the far corner.

Banega was again involved for Sevilla’s second shortly after half-time as his quick free-kick allowed Ocampos to weave his way through while Vazquez made it three with a smart finish from six yards.

Sevilla should have been home and dry but la Real had already hit the post through Jordan and pulled one back when Portu made the most of Odegaard’s pass. Sevilla held on.