Real Madrid engineered a stunning reversal in their Champions League fortunes after a brace from Karim Benzema ensured they beat Borussia Monchengladbach to finish top of Group B with ten points.
All four teams in the group went into the final round of matches knowing that victory would see them progress to the last 16.
Thirteen-time European champions Real – who have never been knocked out at the group stage – needed a victory over Borussia Monchengladbach to progress for the 23rd year in a row.
With speculation mounting that manager Zinadine Zidane would be sacked if Real lost, Benzema ensured his fellow Frenchman kept his job for the time being with two first half goals as the Spanish side kept up their record of last 16 appearances.
The loss didn’t prove too costly for the Germans though, as they joined Real in the next round after Inter Milan could only draw 0-0 with Shaktar Donetsk at the San Siro.
Bottom of the group Inter finished with six points and are out of European competition entirely, while Shaktar who finished level on points with Moenchengladbach but are below the Germans because of an inferior head-to-head will play in the Europa League.
Elsewhere, Atletico Madrid made sure of their place in the next round with a 2-0 victory at Red Bull Salzburg in Group A.
A win for either side would have seen them qualify behind group leaders Bayern Munich but it was the Spanish side who seized the opportunity with Mario Hermoso and Yannick Carrasco scoring either side of half time to condemn Salzburg to the Europa League.
Lokomotiv Moscow finished bottom of the group after a 2-0 loss at Bayern with Niklas Sule and Eric Maxim Choupo-Moting on target for the champions.
Sergio Aguero scored on his return from injury as Group C winners Manchester City beat Marseille 3-0 at the Etihad.
Aguero hadn’t played since 25 November but came on in the second half to score City’s second after Ferran Torres’ opener with Raheem Sterling adding a late third for the English side.
Porto, who had already secured second place behind City beat ten-man Olympiakos in Greece with Nigeria’s Zaidu Sanusi on for the entirety of the game as goals from Otavio and Mateus Uribe gave the Portuguese side a 2-0 win against the Greek side who drop to the Europa League.