Inter Milan were bundled out of the competition following a 2-1 loss to a second-string FC Barcelona in Group F at the San Siro.
Barca went ahead through Carles Perez midway in the first half, but Romelu Lukaku levelled before halftime, as Inter had three goals in either half disallowed.
Ansu Fati had the final sayfive minutes before full-time, sending Inter to the Europa League for the second year running.
Borussia Dortmund booked a ticket in the knockout stages following a 2-1 win over Slavia Praha in Group F's other encounter.
Jadon Sancho and Julian Brandt were on target for the hosts to cancel out Tomas Soucek's strike for the visitors, while Dortmund had Julian Weigl sent off after 77 minutes.
Chelsea qualified to the last 16 of the UEFA Champions League following a 2-1 win at home to LOSC Lille in Group H on Tuesday evening.
Goals inside the first 35 minutes from Tammy Abraham and Cesar Azpilicueta put the Blues on course before Loic Remy netted the consolation in the latter stages of the half.
Valencia joined Chelsea in the knockout stages after edging Ajax Amsterdam 1-0 at the Johan Cruyff Arena in Amsterdam.
Rodrigo provided the all-important strike in the 24th minute, with Gabriel sent packing deep into time added on.
Last year's semi-finalists Ajax will now head to the UEFA Europa League after finishing third in the group.
Olympique Lyon and RB Leipzig played to an entertaining 2-2 draw at the Parc Olympique Lyonnais in Group G.
Leipzig went ahead at halftime through Emil Forsberg and a penalty from Timo Werner, but Houssem Aouar and Memphis Depay pulled the hosts level in the second half, as both progress.
Benfica humbled Zenit St Petersburg 3-0 in the group's other clash, with Zenit finishing a man short in Lisbao.
Goals from Franco Cervi, a penalty from Pizzi and own-goal from Sardar Azmoun gave the Portuguese side victory, but the hosts finished the game with 10 men after Douglas Santos was dismissed after 56 minutes.