Groups F and H: A David Beckham free-kick and a gem of a goal by Ronaldo propelled Real Madrid to a 2-1 win over Olympique Marseille last night on Zinedine Zidane's return to the city of his birth.
Because of Porto's 2-1 victory over Partizan Belgrade, Marseille would have been knocked out of the tournament whatever the result in the Stade Velodrome.
But they were not disgraced against Los Galacticos - who had already qualified for the last 16 - and matched their visitors in a rousing second half, highlighted by a fine performance from striker Didier Drogba.
Ahmed Mido brought Marseille level with a header in the 63rd minute after Beckham, the man of the match with an all-action display, had opened the scoring in the 35th with a trademark goal from just outside the area.
Beckham then set up Ronaldo's 73rd-minute winner by racing back into the Real area to break up a Marseille attack.
He smacked the ball down the line to Luis Figo and it was fed through Raul in a blink of an eye before Ronaldo was released and prodded the ball home from close in.
South African striker Benny McCarthy ensured Porto join Real in the knockout stage after he scored both goals in his side's 2-1 home win last night.
GROUP H: Holders AC Milan booked their place in the last 16 with a 1-0 win at Ajax last night.
Andriy Shevchenko broke the deadlock after 51 minutes, chesting down Cafu's pinpoint cross before coolly shooting past Ajax goalkeeper Bogdan Lobont.
The group leaders were rarely troubled by an under-strength Ajax and should have increased their lead when Clarence Seedorf headed over from a Shevchenko cross.
Milan will finish as group winners. Ajax are second on six points, and must beat Club Bruges, who are bottom with five points, in their final game to guarantee qualification.
An injury-time strike from substitute Rune Lange allowed Bruges to scramble a 1-1 draw against Celta Vigo, that kept alive their chances of making the last 16.
Lange sent a glancing header in at the far post after a neat chipped pass from fellow substitute Kevin Roetlandts to cancel out a 74th minute strike from Celta midfielder Alexander Mostovoi.
Celta dominated possession for most of the match, but lacked sting in attack and the game looked to be heading for a goalless stalemate until Mostovoi broke the deadlock with a close-range finish after an excellent cross from defender Eduardo Berizzo.