Atletico Madrid made it through to the knockout stages and broke Porto’s hearts with victory at Estadio do Dragao in a match full of incident.
Atletico had to win to progress and they took the lead after 56 minutes through Antoine Griezmann. However, Yannick Carrasco’s 67th-minute red card made their task more difficult.
The hosts shot themselves spectacularly in the foot, though, when they were reduced to 10 men with the sending off of Borges Wendell.
As Porto pushed for the goal that would keep them in the competition, they were twice hit on the counter attack in injury time through goals from Rodrigo De Paul and Angel Correa.
Sergio Oliveira tucked away a very late penalty but it was too little too late.
AC Milan are out of Europe this season after losing 2-1 to Liverpool at San Siro. The hosts led through Fikayo Tomori’s tap-in but goals from Mohamed Salah and Divock Origi either side of half-time saw Liverpool make it six wins from six matches in the group.
Real Madrid topped Group D after beating Inter Milan 2-0 at the Bernabeu. Toni Kroos and Marco Asensio scored the goals and Inter, who had Nicolo Barella sent off, finished second.
Sheriff Tiraspol will head into the Europa League after finishing third in the group. Boban Nikolov’s injury-time equaliser earned the Moldovan minnows a 1-1 draw at Shakhtar Donetsk.
Borussia Dortmund beat Besiktas 5-0 but it was not enough for them to go through and it will also be Europa League football for them in the new year.
Erling Braut Haaland and Marco Reus both scored twice but it was only good enough for third place in the group, despite Sporting Lisbon losing 4-2 at Ajax.
The top two places in Group A were already decided but RB Leipzig’s 2-1 home win over group winners Manchester City kept them in Europe.
Goals from Dominik Szoboszlai and Andre Silva sealed third place, despite Riyad Mahrez’s reply for the English champions – who had Kyle Walker sent off.
Kylian Mbappe and Lionel Messi each scored twice in Paris Saint Germain’s 4-1 win against Club Brugge.