Ezequiel Lavezzi struck a 61st minute winner as Paris St Germain edged past Porto to emerge as winners of UEFA Champions League Group A with a 2-1 victory in the French capital.
Knowing only a win would be good enough to claim top spot at the expense of their rivals, Carlo Ancelotti's men started well with Thiago Silva firing them in front just before the half-hour mark.
Jackson Martinez equalised three minutes later for the visitors but Lavezzi's effort guaranteed Paris would top the group on 15 points, with the Portuguese side joining them in the knockout stages two points behind.
In a match temporarily suspended due to snow, Dinamo Zagreb claimed their first and only point in the group when Ivan Krstanovic hit an injury time penalty to draw 1-1 at home to Dynamo Kiev, who had taken the lead through Andriy Yarmolenko.
Arsenal failed to capitalise on Schalke's surprise draw at already-eliminated Montpellier, with the Gunners' 2-1 defeat at Olympiakos forcing them to settle for the runners-up spot behind the Germans in Group B.
Victory for Arsenal would have seen them clinch top spot after Schalke were held in France. Benedikt Howedes put the visitors in front after 56 minutes but Emanuel Herrera equalised for Montpellier just three minutes later.
In Group C, a 35th minute goal by Danny gave Zenit St Petersburg a surprise 1-0 win over runners-up Milan in the San Siro and guaranteed the Russians the consolation prize of a Europa League berth.
Group winners Malaga eased to a 2-2 home draw with Anderlecht with two goals from Duda, with the Belgians - whose hopes of third place were extinguished by Zenit's win - twice equalising through Milan Jovanovic and Dieumerci Mbokani.
Real Madrid had to settle for second place in Group D despite a 4-1 win over Ajax. Jose Callejon scored twice and was joined on the scoresheet by Cristiano Ronaldo and Kaka, while Derk Boerrigter replied for Ajax, who head for the Europa League.