Manchester City crashed out Europe altogether, while Arsenal missed out on top spot after both sides lost on Tuesday night.
Roberto Mancini's men were playing for third spot in Group D, but they slumped to a 1-0 defeat to group winners Borussia Dortmund.
Julian Schieber's second half goal proved enough to give Dortmund all three points and end City's involvement in Europe this term
After a quiet first half Dortmund came out in determined fashion at the start of the second half and City keeper Joe Hart made two good saves to keep out Ivan Perisic's volley and Kevin Grosskreutz's shot at his near post.
The German champions made their dominance count on 57 minutes when Jakub Blaszczykowski's brilliant cross from the right was slid home from close-range by Schieber.
Carlos Tevez and Sergio Aguero went close for City, but they were both denied by Roman Weidenfeller as City failed to win a game in their Group D campaign.
Ajax secured the Europa League spot in Group D despite going down 4-1 to Real Madrid in the Bernabeu.
Real opened the scoring after just 13 minutes with Cristiano Ronaldo getting his name on the scoresheet.
Jose Callejon added a second on 28 minutes with a fine finish from Luka Modric's pass and Kaka made it 3-0 four minutes after the break.
Derk Boerrigter pulled a goal back for Ajax just before the hour mark, but Callejon added his second of the contest two minutes from time to complete the rout for Real.
Arsenal's poor run of form continued as they threw away a 1-0 lead to lose 2-1 to Olympiakos in Greece to condemn to second spot in Group B.
Arsenal grabbed the lead on 38 minutes when Gervinho burst into the box and picked out Tomas Rosicky on the edge of the box who drilled his shot into the corner of the net.
Olympiakos drew level on 65 minutes when Arsenal failed to deal with Djamel Abdoun's cross into the box and Giannis Maniatis was on hand to fire the ball past Wojciech Szczesny.
Things got worse for Arsenal when substitute Kostas Mitroglou found space on the edge of the box and curled a shot past Szczesny.
Schalke finished as Group B winners after earning a 1-1 draw with Montpellier in France.
After a goalless first half Bendikt Howedes fired Schalke in front on 56 minutes, but the lead proved short-lived with Emanuel Herrera equalising for Montpellier just three minutes later.
Zenit St Petersburg took third spot in Group C and a place in the Europa League with a 1-0 win over already qualified AC Milan.
Portuguese striker Danny scored the winning goal for Zenit on 35 minutes to ensure they pipped Anderlecht to third spot.
Dieumerci Mbokani's late goal earned Anderlecht a 2-2 draw with Malaga, but it was not enough for the Belgians as they finished bottom of Group C.
Malaga broke the deadlock right on the stroke of half-time through Duda only for former Liverpool man Milan Jovanovic to draw Anderlecht level five minutes after the break.
Duda restored Malaga's lead on 61 minutes, but Dieumerci Mbokani earned Anderlecht a point with a last-minute leveller.
Paris St Germain secured top spot in Group A with a 2-1 win over Porto at the Parc des Princes.
Thiago Silva set PSG on their way on 29 minutes, but Porto striker Jackson Martinez levelled matters for the visitors just four minutes later.
Ezequiel Lavezzi grabbed the winner for PSG just past the hour mark to ensure Carlo Ancelotti's side won the group.
Dinamo Zagreb picked up their first point in Group A after a last-gasp 1-1 with Dynamo Kiev in a snowy Zagreb.
The game was briefly delayed because of heavy snowfall with referee Stanislav Todorov leading both teams off the pitch after 10 minutes.
Play was halted for around 15 minutes as groundstaff painted the lines on the pitch red before the game got under way again.
Deep into added time in the first half Kiev broke the deadlock with a superb effort from Andriy Yarmolenko from the edge of the box which went in off the underside of the crossbar.
Zagreb looked like finishing the group without picking up a point until Ivan Krstanovic scored from the penalty spot deep into injury time.