Tottenham Hotspur have weathered a first-half siege, snatching an unlikely 2-1 victory at Olympique de Marseille to reach the Champions League last 16 as Group D winners, after a nerve-jangling conclusion.
The Londoners, who needed only to avoid defeat to progress, were on the ropes, when they trailed to Chancel Mbemba's header in first-half stoppage time.
However, French central defender Clement Lenglet proved to be Tottenham's saviour, when he headed in his first goal for the club in the 54th minute.
Spurs, who lost forward Son Heung-min to a head injury in a torrid opening period, were a different team after the break and took control after Lenglet's equaliser.
Pierre-Emile Hojbjerg struck the crossbar for the visitors, but Marseille should have scored late, when Sead Kolasinac somehow missed an open goal with a header.
Hojbjerg then sealed the victory in stoppage time to put Tottenham top of the group and leave Marseille, who at one point in the evening were top, in fourth spot and out of Europe.
Meanwhile, late goals from Mohamed Salah and Darwin Nunez have earned Liverpool a 2-0 victory over Napoli, but it was not enough to deny the Italians top spot in Champions League Group A.
Both teams had already sealed a knockout stage place, but top spot in the group and a potentially more favourable last-16 opponent were still up for grabs, with Liverpool needing to beat Napoli by four goals or more to sneak to the summit.
The first half felt like an encounter where both teams' main priority had been fulfilled, but the game sprang to life early in the second, when Leo Ostigard thought he had put Napoli in front, only for his header to be ruled offside after a video check.
With nothing to lose and top spot out of reach, Liverpool did at least manage to secure victory on the night, with Salah prodding home at the far post five minutes from time, before Nunez added a second in stoppage time.
Napoli's 4-1 demolition of Liverpool in their group opener in September proved crucial in the end, as they finished on 15 points, the same as Liverpool, but with a better goal difference in clashes between the pair.
Bayern Munich completed a perfect group stage by beating fellow qualifiers Inter Milan 2-0, thanks to goals from Benjamin Pavard and Eric Maxim Choupo-Moting in their final Group C game.
Bayern ended top on 18 points, eight ahead of second-placed Inter, with both teams already reaching the knockout stage.
Barcelona finished third on seven points, eliminated in the group stage and having to settle for a Europa League place for the second year in a row.
With Bayern and Inter having nothing riding on the game, it was an affair that won't live long in the memory.
Ajax Amsterdam made sure of a place in the Europa League, beating Rangers 3-1 away at Ibrox to heap further Champions League misery on the Scottish club.
Ajax finished third in Group A, behind Napoli and Liverpool, and will compete in the Europa League knockout round playoffs, as Rangers finished bottom, after losing all six group games - the first Scottish side to suffer the fate - and returned the worst figures in the three decades of Champions League group competition.
In other results, Eintracht Frankfurt staged a second-half comeback, scoring twice in 10 minutes to beat hosts Sporting 2-1, while Porto beat Atletico Madrid 2-1.
Reuters