Gonzalo Higuain's goal helped gave Napoli a 2-0 win over 10-man Arsenal in their final Champions League Group F game, as the Gunners qualified in second place following a late victory for Borussia Dortmund away to Marseille.
Arsenal needed a point to be sure of seeding for the knockout stage, but will now likely face one of Europe's leading sides such as Barcelona, Bayern Munich, Real Madrid or Paris St-Germain in Monday's draw.
Higuain, who was a summer transfer target for Arsenal, slotted home on 73 minutes to finally break Arsenal's determined resistance and after Mikel Arteta was shown a second yellow card, it was always going to be an uphill battle to get back into the tie.
Jose Callejon chipped in a second during stoppage time, but it was not enough and Rafa Benitez's men must now regroup for the Europa League.
Napoli started brightly, cheered on by their ferocious support at the Stadio Sao Paulo, with Goran Pandev forcing an early save from Wojciech Szczesny.
Arsenal, though, should have gone ahead on 23 minutes but club-record signing Mesut Ozil completely missed his kick after the ball dropped to him inside the Napoli penalty area following a fierce drive by Olivier Giroud.
Napoli skipper Cristian Maggio clipped an angled shot over the bar as Szczesny raced out of his area and, as half-time approached, the Poland stopper saw his clearance bounce off Gonzalo Higuain's head and drop just past the post.
Napoli had to up their game in the second half and left-back Pablo Armero blasted straight at the Arsenal keeper when played into the penalty area on 57 minutes.
Two Greenpeace protesters then abseiled down from the roof to unveil a protest banner before the Italians finally went in front when Higuain turned inside the right side of the penalty area and drove a low shot into the corner of the net.
The Gunners were then reduced to 10 men when Arteta fouled Callejon, which Hungary referee Viktor Kassai deemed enough for a second yellow card.
Callejon clipped in a late second as Arsenal went through in runners-up spot on head-to-head record compared to the Germans.
Arsenal were aiming to reach the Champions League knockout stage for the 14th successive season and manager Wenger elected to start with Jack Wilshere, Theo Walcott and Aaron Ramsey all on the bench.
The Barclays Premier League club had warned supporters to take extra care in and around the city following previous problems with Napoli's 'Ultra' hardcores.
Although special buses had been laid on to take the travelling fans out to the stadium, many were delayed resulting in several hundred missing kick-off, with additional problems caused by late congestion outside the entrance gate.
On the pitch, Napoli produced their expected positive start, with an early goal for qualification rivals Dortmund in Marseille putting extra pressure on Benitez's men.
Pandev got away down the left and his angled shot was held by Szczesny.
It then needed a solid block from German centre-half Per Mertesacker after left-back Armero had broken quickly on the counter-attack.
Arsenal's big chance came on 23 minutes when Ozil fed Mathieu Flamini, recalled to the starting XI, who in turn played a delightful pass over to Giroud on the left.
The France forward cut inside and drove the ball goalward, which Rafael Cabral - replacing the unfit Pepe Reina for a Champions League debut - parried and it dropped right into the path of Ozil, only for the German to lose his footing just as he shaped to shoot.
Callejon curled a 25-yard shot over the crossbar but Arsenal largely continued to frustrate the Italians, which was half the battle as the home support grew edgy - with Mikel Arteta and Flamini doing a good job of breaking up play in central midfield.
However, there was a let-off for the Gunners on 37 minutes when full-back Maggio got clear down the right and Szczesny came racing out to the edge of the penalty area. The chip from the Napoli captain, though, floated over the crossbar.
The Poland keeper was then almost embarrassed when his clearance bounced off the head of Higuain - a summer transfer target for Arsenal - and just wide.
Arsenal were more positive at the start of the second half as they looked to close in on the positive result needed to top the group, with Ozil firing wide from 20 yards after being set up by Santi Cazorla.
As the hour approached, Napoli needed to find something soon and should have when Armero skipped into the penalty area, but his tame shot was straight at the keeper from point-blank range.
Callejon then dragged a shot across goal and wide from the right - much to the disapproval of the home support.
With 25 minutes left, Cazorla was replaced by Ramsey, whose goal in Dortmund last month had set Arsenal back on course for the knockout stage.
Napoli swept in front after 73 minutes when Higuain was given time to turn in the Arsenal box and fire a low shot past Szczesny.
The visitors had to play the final 14 minutes with 10 men after Arteta collected what looked a somewhat harsh second caution for fouling Callejon.
From then on it it was always going to be damage limitation, but the news of the late goal for Dortmund to win in Marseille dampened the atmosphere before Callejon stroked home a second in stoppage time.