Arsenal sneaked into the last 16 of the UEFA Champions League by the narrowest of margins while Napoli dramatically missed out as the group stage concluded on Wednesday evening.
Napoli beat Arsenal 2-0 in their final game in Group F with second-half goals from Gonzalo Higuain and Jose Callejon as the Gunners finished with 10 men following the sending-off of Mikel Arteta.
Meanwhile, last season's beaten finalists Borussia Dortmund won too, downing 10-men Marseille 2-1 in France thanks to a late strike from Kevin Grosskreutz after Souleymane Diawara had cancelled out Robert Lewandowski's opener.
That ensured a three-way tie atop the section, with Dortmund, Arsenal and Napoli all finishing on 12 points, and the German side progressed as group winners thanks to their better head-to-head record.
Arsenal, meanwhile, qualified for the knockout stages for the 14th year running, but one more Napoli goal would have taken the Italians through at their expense.
Instead, Napoli become the first team to finish third with 12 points in a Champions League group and the first to be eliminated with such a tally since 1997.
Then, Paris Saint-Germain failed to progress with the same number of points at a time when only the group winners were guaranteed to go through.
Meanwhile, Marseille, who had Dimitri Payet sent off in the first half, became the first French side to finish a Champions League campaign without registering a single point.
"Napoli played well tonight, but in the end we got through," said Arsenal manager Arsene Wenger. "Maybe Napoli played a little bit with the handbrake on when they led 1-0 because they thought they were through.
"We had a very difficult group. Three teams got 12 points so one of us had to go out."
A relieved Dortmund coach Jurgen Klopp described his side's win as "an awesome feeling" while Napoli coach Rafael Benitez was left to reflect on what might have been.
"I am very sad, but also very proud of my team and of the feeling between the team and the fans," said the Spaniard. "We couldn't have done any more."
In stark contrast to Napoli's pain, Zenit St Petersburg finished as runners-up in Group G, becoming the first side to progress to the last 16 despite collecting just six points.
The Russians took the lead away to Austria Vienna through Aleksandr Kerzhakov only to eventually lose 4-1, Philipp Hosiner scoring twice for the hosts with Tomas Jun and substitute Roman Kienast also on target.
Two-time European champions Porto would have gone through at Zenit's expense had they won away to group winners Atletico Madrid, but they went down 2-0 in the Spanish capital as Raul Garcia and Diego Costa scored for the hosts.
Neymar treble fires Barcelona
Barcelona secured top spot in Group H thanks to a 6-1 hammering of Celtic at the Camp Nou, which featured goals by Gerard Pique, Pedro Rodriguez, Cristian Tello and a hat-trick by Neymar.
The Brazilian became the first player to score a triple in both South America's Copa Libertadores and the Champions League, while a late Giorgios Samaras consolation could not prevent the defeat from being Celtic's heaviest in Europe.
"I am very happy to score my first three goals in the Champions League, but the most important thing was that the team played well," Neymar told Spanish TV station Canal Plus. "We needed to change the dynamic after recent defeats and now we have to concentrate on La Liga."
AC Milan also progressed after getting the point they needed from a nervous 0-0 home draw against Ajax.
And in Group E, Chelsea clinched top spot with a less than convincing 1-0 victory against Steaua Bucharest, sealed courtesy of an early Demba Ba goal, while Schalke ensured that there will be four German sides in the last 16 after beating Basel 2-0 in Gelsenkirchen.
Julian Draxler and Joel Matip got the goals early in the second half to ease the pressure on Schalke coach Jens Keller.
"No one can understand the pressure the team and I were under," said Keller. "The joy in winning a game like that is huge."
The draw for the last 16 will take place at UEFA headquarters in Nyon, Switzerland on Monday.