Robert Lewandowski’s first-half free-kick was enough to earn Bayern Munich all three points against Atletico Madrid.
Bayern went into the game with no chance of topping Champions League Group D after slipping to a shock 3-2 defeat away to Rostov on matchday five.
But the struggling German outfit salvaged some pride through Lewandowski’s 28th-minute strike.
The win ended Atleti’s hopes of qualifying for the knockout stages with six victories from six and ensured Bayern progressed just three points behind the Spanish outfit as group runners-up.
In the group’s other game Rostov ensured qualification for the Europa League with a draw away to PSV Eindhoven.
Elsewhere, Napoli secured top spot in Group B with a 2-1 victory at Benfica as both sides progressed into the knockout stages.
Napoli knew a draw in Lisbon would be enough to qualify but Benfica needed to win, or rely on Besiktas slipping up against Dynamo Kiev, to seal their last-16 place.
Kiev’s remarkable 6-0 victory against nine-man Besiktas eased any nerves at the Estadio da Luz but second-half goals from Jose Callejon and Dries Mertens helped secure top spot for the Italians, despite Raul Jimenez’s late consolation for the hosts.
Barcelona and Manchester City were already guaranteed to finish as winners and runners-up of Group C respectively, but that didn’t stop the Catalans putting out a strong side against Borussia Monchengladbach.
Lionel Messi opened the scoring in the 16th minute before a second-half hat-trick from Arda Turan sealed a resounding 4-0 win for Luis Enrique’s side.
City, meanwhile, could only manage a 1-1 draw with Celtic after striker Kelechi Iheanacho cancelled out the Scottish champions’ opener, scored by City loanee Patrick Roberts.
In Group A Paris Saint-Germain slipped up, drawing 2-2 at home to Ludogorets and allowing Arsenal to clinch top spot in the group with a 4-1 win in Basel.
Lucas Perez notched a hat-trick for the Gunners in Switzerland while Alex Iwobi also got on the scoresheet.
Results in full
Group A: PSG 2-2 Ludogorets; Basel 1-4 Arsenal
Group B: Napoli 2-1 Benfica; Dynamo Kiev 6-0 Besiktas
Group C: Barcelona 4-0 Borussia Monchengladbach; Manchester City 1-1 Celtic
Group D: Bayern Munich 1-0 Atletico Madrid; PSV Eindhoven 0-0 Rostov