Porto clinched top spot in their Champions League group with a 3-1 win over Schalke 04 on Wednesday with both sides already qualified for the round of 16.
Lokomotiv Moscow's 2-0 win over Galatasaray in an earlier Group D match sent the Portuguese champions and the Bundesliga side through before they had kicked a ball at the Estadio do Dragao.
Porto struck twice in three minutes early in the second half to take control. Eder Militao put them ahead in the 52nd minute with an emphatic header from Oliver Torres' cross and Jesus Corona added the second after a clever exchange of passes with Yacine Brahimi.
Nabil Bentaleb pulled one back from a penalty in the 89th minute after Torres handled but Porto had the last word, Moussa Marega racing on to Otavio's through ball to complete the scoring deep into stoppage time.
Porto have 13 points from five games with Schalke on eight and Galatasaray on four.