A stoppage-time goal from Joao Mario completed a 6-1 win for the Portuguese side at Maccabi Haifa and edged them above PSG in Group H, despite the French side winning 2-1 at Juventus courtesy of goals from Kylian Mbappe and Nuno Mendes after Leonardo Bonucci had equalised for the Italians in the first half.
Benfica and PSG ended the group stage with the same number of points, goals scored and goal difference, with both games between the sides finishing in 1-1 draws.
Goals from Goncalo Ramos, Petar Musa, Alex Grimaldo, Rafa Silva, Henrique Araujo and Mario - five of them in the second half - gave Benfica the dramatic win in Israel.
Mario's superb long-range strike prompted wild celebrations as the Benfica substitutes and coaching staff ran onto the pitch.
Former Arsenal and Chelsea striker Olivier Giroud scored two goals and created another as AC Milan thrashed Red Bull Salzburg 4-0 to reach the Champions League knockout stages for the first time since 2013-14.
Champions League group tables Champions League results Latest Champions League news Get Sky Sports
Needing to avoid defeat in their final Group E match to reach the last 16 against an Austrian side gunning for the win that would take them through, Giroud settled any nerves around the San Siro with an early header into the bottom corner.
The 36-year-old expertly headed across for Rade Krunic to make it two 43 seconds into the second half and Giroud put the game to bed in the 57th minute, drilling home after fine work from Rafael Leao.
A solo goal from Junior Messias in stoppage-time capped an excellent night for Milan who secured second spot in Group E behind Chelsea. Red Bull Salzburg will go into the Europa League after finishing third.
RB Leipzig eased past Shakhtar Donetsk 4-0 to qualify for the Champions League last 16 in style as the Ukrainians dropped down to the Europa League.
Leipzig, who only needed a point to advance to the knockout stage, hit three quickfire second-half goals to secure second place in Group F behind Real Madrid and join fellow Bundesliga clubs Bayern Munich, Borussia Dortmund and Eintracht Frankfurt in the next round.
Marco Rose's side won thanks to goals from Christopher Nkunku, Andre Silva, Dominik Szoboszlai and Dani Olmo.
FC Copenhagen scored their only goal in this season's Champions League campaign, drawing 1-1 with already-qualified Borussia Dortmund on Wednesday in their last Group G game.
The Danes had been condemned to last place from the previous matchday and, despite resting several players, Dortmund struck first through Thorgan Hazard's well-taken shot at the far post against the run of play in the 23rd minute.
Copenhagen put the Germans firmly on the back foot in the first half and had 12 shots on goal before being rewarded with Hakon Haraldsson's 41st-minute equaliser, their first goal in the group stage.
Dortmund improved after the break and hit the post through substitute Youssoufa Moukoko in the 64th minute as they qualified behind Group G winners Manchester City.
Correctly predict six scorelines to win £250,000 for free with Super 6 on Tuesday. Entries by 8pm.