Real Sociedad snatched qualification for the last 32 of the Europa League in the final seconds on Thursday after Willian Jose's late leveller in a 1-1 draw at Napoli and AZ Alkmaar's shock 2-1 defeat at Rijeka allowed the Spanish side to progress.
La Liga high fliers Sociedad were heading out of Europe as the final two matches of Group F headed into stoppage time, with AZ Alkmaar set to go through in second place as the Dutch side were drawing at bottom side Rijeka and Napoli led in Naples thanks to Piotr Zielinski's fine first half strike.
However Jose's thumping finish to level the scores at a soaking Stadio Diego Armando Maradona put the Basque outfit back into second place, and Ivan Tomecak's 93rd-minute winner for Rijeka in Croatia confirmed Alkmaar's elimination.
Napoli finish top of the group on 11 points, two ahead of Sociedad in second who end the group stage a further point ahead of Alkmaar.
Napoli knew that despite racking up 10 points in their previous five matches a defeat could cost them qualification and coach Gennaro Gattuso started a strong team that was still missing injured forward Victor Osimhen.
Sociedad meanwhile needed to match Alkmaar with the pair level on eight points and despite missing Mikel Oyarzabal started the stronger, with Willian Jose testing David Ospina, Mario Ruiz almost heading into his own net and Cristian Portu somehow firing wide in front of an open goal with less than 20 minutes gone.
Zielinski made Sociedad pay for these misses when he opened the scoring against the run of play in the 35th minute when he classily brought down a clearance from a corner and lashed home a powerful finish.
Sociedad dominated the second period and twice came close to grabbing the leveller through Mikel Merino's curling strike which just flashed wide six minutes after the restart and a low cross just seconds later with which Willian Jose failed to connect.
However Jose sparked wild celebrations when he span and hit his shot into the roof of Ospina's net, sending his team into next week's draw.
Young Boys also qualified in dramatic fashion in the last round of group matches in this year's competition, on a night when iconic Italian striker Paolo Rossi was remembered across Europe after his death late on Wednesday night.
A 93rd-minute penalty from Jean-Pierre Nsame and Gianluca Guadino's strike three minutes later sent the Swiss side through alongside Group A winners Roma with a 2-1 win over Cluj that also featured three red cards.
Cluj are out of Europe thanks to the two stoppage-time strikes, which came after Gabriel Debeljuh had put the Romanians provisionally second in the group with just six minutes remaining in Bern.
Molde's 2-2 draw with Rapid Vienna was enough to see them through from Group B in second place behind Arsenal.
The Gunners finished the group stage with a perfect six wins from six after easing past bottom side Dundalk 4-2, while Rangers finished top of Group D thanks to their 2-0 win at Lech Poznan.