Nuno Mendes scored the winning goal within moments of coming on as a second-half substitute as Paris Saint-Germain beat Juventus 2-1 in Turin on Wednesday but the French side missed out on top spot in Champions League Group H in dramatic fashion to a rampant Benfica.
PSG and Benfica were both through to the last 16 before their final group games and sat level on points having drawn both of their meetings 1-1.
However, the Parisians' goal difference was superior by four, meaning victory in Italy against an already-eliminated Juventus looked set to be enough to secure a theoretically easier tie in next Monday's last-16 draw.
Mendes duly netted the decisive goal midway through the second half after Kylian Mbappe's stunning opener had been cancelled out by Leonardo Bonucci.
Yet the biggest drama was in the other game where Benfica scored five second-half goals to beat Maccabi Haifa 6-1 to leapfrog PSG into top spot.