Philippe Mexes scored with a stunning overhead kick as AC Milan booked a place in the Champions League last 16 with a 3-1 win away to Anderlecht.
The France international added to Stephan El Shaarawy's opener before Alexandre Pato sealed victory.
Paris St-Germain sealed progress from Group A, while Schalke and Arsenal went through in Group B.
Borussia Dortmund won Group D with a 4-1 win over Ajax, with Real Madrid joining them in the knockout stages.
Ezequiel Lavezzi scored a goal in each half as Paris St-Germain ensured qualification with a 2-0 away win over Dynamo Kiev.
The Argentina striker took on Zlatan Ibrahimovic's pass for the opener right on half-time, then grabbed a second soon after the interval.
Carlo Ancelotti's side are a point behind group leaders Porto, who had already qualified before their 3-0 home win over Dinamo Zagreb.
That result leaves Zagreb bottom of the group with no points, and ensures Kiev will finish third and go into the Europa League.
Christian Fuchs grabbed a winner 13 minutes from the end to ensure Schalke clinched qualification with a 1-0 home victory over Olympiakos.
They remain a point ahead of Arsenal, who are also through after beating Montpellier 2-0, although top spot remains at stake.
Schalke will finish top of the group if they win their final game away to Montpellier. Olympiakos will go into the Europa League.
French defender Mexes struck with a spectacular overhead kick as AC Milan ensured their progress with a game to spare by beating Anderlecht 3-1.
El Shaarawy had given Milan the lead early in the second half, before Bram Nuytinck was sent off for the hosts.
Mexes' stunning goal gave the visitors breathing space, and Pato finished the job in stoppage time after Tom De Sutter had pulled one back for Anderlecht, who will battle it out with Zenit St Petersburg for the Europa League spot.
Malaga sealed top spot in the group despite letting a two-goal lead slip in drawing 2-2 away to Zenit.
Diego Buonanotte and Seba scored inside the first nine minutes for a Malaga side minus several rested players.
But Danny pulled one back just before half-time, and then Viktor Fayzulin struck a late equaliser for Zenit, who had Vladimir Bystrov sent off right at the end.
Robert Lewandowski scored twice for Borussia Dortmund as they made certain of topping their group with a 4-1 victory over Ajax in Amsterdam.
Marco Reus opened the scoring for the German champions, and Mario Goetze added a second before Poland striker Lewandowski struck either side of the break.
Daniel Hoesen scored a late consolation for Ajax, whose hopes of qualifying for the last 16 were ended.
Real Madrid's 1-1 draw at Manchester City sealed second place in the group. City can still make the Europa League, but only if they win in Dortmund next month and Ajax fail to win at the Bernabeu.