Inter Milan secured their place in the Champions League knockout stage and sent Barcelona into the Europa League with victory against Viktoria Plzen.
Substitute Romelu Lukaku marked his return from injury with a late goal as Inter comfortably secured the win they needed to reach the last 16.
Edin Dzeko scored twice after Henrikh Mkhitaryan's opener.
Inter's final opponents Bayern Munich will secure top spot in Group C if they beat Barcelona later on Wednesday.
Barcelona, who host Bayern at 20:00 BST, are guaranteed to finish third and compete in Europe's second-tier competition for the second successive season.
Simone Inzaghi's Inter, who kept their fate in their own hands with a 3-3 draw at Barcelona a fortnight ago, are two points behind Bayern after taking 10 points from five games.
With Inzaghi serving a touchline ban, Federico Dimarco was denied at close range by Plzen goalkeeper Jindrich Stanek as Inter dominated from the start at the San Siro.
Midfielder Mkhitaryan headed in Alessandro Bastoni's cross from the left as Inter broke the deadlock with their 10th attempt after 35 minutes.
Dzeko slotted in from Dimarco's pass to double the lead over the Czech champions before the interval.
Mkhitaryan struck the post 10 minutes into the second half, but Dzeko's second from a Lautaro Martinez assist put the result beyond doubt.
Lukaku added a fourth within four minutes of coming off the bench in his first appearance since August because of a hamstring injury.
Line-ups
Inter Milan
Formation 3-5-2
24Onana
37Skriniar15Acerbi95Bastoni
2Dumfries23Barella20Çalhanoglu22Mkhitaryan32Dimarco
10Martínez9Dzeko
24Onana37Skriniar15Acerbi95Bastoni2Dumfries23Barella20ÇalhanogluSubstituted forAsllaniat 71'minutes22MkhitaryanSubstituted forGagliardiniat 83'minutes32DimarcoSubstituted forGosensat 77'minutes10MartínezSubstituted forLukakuat 83'minutes9DzekoSubstituted forCorreaat 71'minutesSubstitutes
1Handanovic5Gagliardini6de Vrij8Gosens11Correa12Bellanova14Asllani21Cordaz33D'Ambrosio36Darmian90LukakuViktoria Plzen
Formation 3-4-2-1
36Stanek
2Hejda4Pernica3Tijani
24Havel23Kalvach20Bucha18Mosquera
77Jirka88Vlkanova
90Bassey
36Stanek2Hejda4PernicaBooked at 49mins3TijaniSubstituted forJemelkaat 52'minutes24Havel23KalvachSubstituted forN'Diayeat 70'minutes20Bucha18MosqueraBooked at 45mins77JirkaSubstituted forHolíkat 45'minutes88VlkanovaSubstituted forPilarat 84'minutes90BasseySubstituted forChoryat 45'minutesSubstitutes
6Pilar13Tvrdon15Chory16Jedlicka21Jemelka25Cermák44Holík99N'DiayeLive Text
Match ends, Inter Milan 4, Viktoria Plzen 0.
Second Half ends, Inter Milan 4, Viktoria Plzen 0.
Attempt missed. Romelu Lukaku (Inter Milan) header from the centre of the box is high and wide to the left. Assisted by Kristjan Asllani with a cross following a set piece situation.
Milan Skriniar (Inter Milan) wins a free kick in the attacking half.
Foul by Jhon Mosquera (Viktoria Plzen).
Foul by Alessandro Bastoni (Inter Milan).
Václav Pilar (Viktoria Plzen) wins a free kick on the right wing.
Attempt saved. Joaquín Correa (Inter Milan) right footed shot from the centre of the box is saved in the bottom right corner. Assisted by Romelu Lukaku with a through ball.
Goal! Inter Milan 4, Viktoria Plzen 0. Romelu Lukaku (Inter Milan) left footed shot from the centre of the box to the bottom left corner. Assisted by Joaquín Correa with a through ball.
Foul by Romelu Lukaku (Inter Milan).
Václav Jemelka (Viktoria Plzen) wins a free kick in the defensive half.
Attempt blocked. Joaquín Correa (Inter Milan) right footed shot from the centre of the box is blocked. Assisted by Robin Gosens.
Substitution, Viktoria Plzen. Václav Pilar replaces Adam Vlkanova.
Corner, Inter Milan. Conceded by Jhon Mosquera.
Substitution, Inter Milan. Romelu Lukaku replaces Lautaro Martínez.
Substitution, Inter Milan. Roberto Gagliardini replaces Henrikh Mkhitaryan.
Corner, Inter Milan. Conceded by Jindrich Stanek.
Attempt saved. Denzel Dumfries (Inter Milan) right footed shot from outside the box is saved in the bottom left corner. Assisted by Robin Gosens.
Corner, Viktoria Plzen. Conceded by Nicolò Barella.
Foul by Milan Skriniar (Inter Milan).