Marseille 1-2 Borussia Dortmund
Borussia Dortmund scraped into the last 16 of the Champions League with Kevin Grosskreutz's 87th-minute strike giving them victory over 10-man Marseille.
Dortmund's Robert Lewandowski beat the offside trap to open the scoring for last season's runners-up with a chip.
But Marseille, who had Dimitri Payet sent off after he picked up a second yellow card for diving, equalised when Souleymane Diawara headed in a rebound.
Dortmund were heading out until Grosskreutz scored the winner.
Before the midfielder bobbled a low shot into the corner, the German side were set for a place in the Europa League, with Napoli heading through behind Arsenal in Group F.
But the goal not only put Jurgen Klopp's men into the last 16, it also proved enough for them to win the group and avoid playing the top seeds.
Arsenal will now have to play Real Madrid, Paris St-Germain, Bayern Munich, Atletico Madrid or Barcelona in the knockout stages after
"This feels fantastic, that was a nerve-shredding game," said Klopp.
"We were in their penalty area every 30 seconds but somehow the ball would not go in."
Lewandowksi chipped in to put Dortmund ahead before Saber Khalifa beat Roman Weidenfeller to a free-kick and headed against the crossbar, with Diawara nodding in the rebound.
When Payet was dismissed, Dortmund had 56 minutes to find a winner against 10 men.
Marco Reus hit the post as Klopp's side piled men forward, and the winner did eventually come as Marseille goalkeeper Steve Mandanda failed to keep out Grosskreutz's mishit effort from 15 yards.