A late goal by Kevin Grosskreutz gave last season's beaten finalists Borussia Dortmund a 2-1 win over 10-man Marseille and the victory they needed to reach the Champions League last 16 on Wednesday.
Dortmund won Group F, but Grosskreutz's goal meant misery for Napoli, who beat Arsenal 2-0 in Italy to finish in a three-way tie on 12 points atop the section, only to miss out because of an inferior head-to-head record with the other two teams.
Marseille, meanwhile, end with the unenviable record of being the first French team to finish a group-stage campaign without any points.
Dortmund caught the Marseille defence napping as early as the fourth minute as Marco Reus found Robert Lewandowski, who turned Lucas Mendes before rifling the ball past Steve Mandanda.
Mendes ended up needing treatment for a bloody cut after Mandanda's boot caught him full in the face as they both came to ground.
However, a mad rush of blood to the head by Dortmund goalkeeper Roman Weidenfeller in the 14th minute gifted Marseille an equaliser, as he came charging out to collect a lofted free-kick only to miss it completely.
Saber Khalifa headed against the bar but Souleymane Diawara was on hand to head into the empty net, although he looked to be in an offside position.
Dortmund -- who were forced to hand fourth-choice centre-back Marian Sarr, 18, his senior debut -- got a huge boost in the 34th minute when referee Marijo Strahonja sent winger Dimitri Payet off for a second bookable offence when he dived in the penalty area.
Payet was furious and demonstrated his displeasure in dramatic fashion by kicking the corner flag before going down the tunnel, breaking it in half.
Dortmund failed to get the breakthrough in the remaining minutes of the first half but should have done so in the first minute of the second period -- Nuri Sahin breaking the Marseille offside trap but placing his low cross behind the onrushing Lewandowski.
Somehow Marseille held out with a mix of some last ditch defending - Mandanda pulling off one excellent save -- and poor Dortmund finishing typified by Lewandowski, who nipped in to seize on a poor back-pass and rounded Mandanda only to shoot into the side-netting.
Substitute Jonas Hofmann also blazed over when only five yards out as Dortmund turned the screw further but without reward.
However, with the news coming through that Napoli were 2-0 up over Arsenal in Italy, Dortmund threw everything at the French side with the minutes dwindling away and they finally cracked with three minutes left.
It was the outstanding Grosskreutz - who has a tattoo of the Dortmund skyline on his back -- that slotted home the decisive goal, actually slipping as he took aim, but he had enough force on his shot to beat Mandanda, who managed to get a hand to it but to no avail.