Real Sociedad pipped Basque rivals Athletic Bilbao to the final Europa League spot with a 93rd minute equaliser at Celta Vigo.
Juanmi’s goal with virtually the final kick of the season was enough to earn Eusebio Sacristan’s men sixth place following a pulsating second half at Estadio Balaidos.
Iago Aspas had given the hosts the lead nine minutes into the second half from the penalty spot but La Real thought they had rescued a point when Mikel Oyarzabal levelled eight minutes from time.
However, Andrew Hjulsager restored the Galician’s lead as the game ticked into stoppage time, meaning the San Sebastian side would miss out on the top six due an inferior head-to-head with Athletic.
A late corner was then floated into the back post, with former Southampton striker Juanmi rising highest to power home and send the visiting fans into raptures.
Celta finish the table in 13th but had a memorable campaign due to their run to the Europa League final, while this was the last match of Coach Eduardo Berizzo before he leaves the club.
The season marks La Real’s best since their fourth-place finish in the 2012/13 campaign.