Porto reached the Champions League last 16 on Wednesday as Galeno netted a double and veteran Pepe scored in a 5-3 victory in their winner-takes-all clash with Ukraine’s Shakhtar Donetsk.
The hosts only needed to avoid defeat at the Estadio do Dragao to progress from Group H with Barcelona, while Shakhtar needed a win to pip them to a top-two finish.
Antwerp beat Barcelona 3-2 in the other group game as Porto finished level with the Catalan giants on points but ended behind them on head-to-head.
Shakhtar had to settle for third place in the group and a spot in the draw for the Europa League knock-out round play-offs.
Galeno forced the ball home from close range to give Porto a ninth-minute lead after Evanilson did well to stretch and pull the ball across for his fellow Brazilian.
But Shakhtar gave themselves hope of a comeback as Danylo Sikan tapped in Oleksandr Zubkov’s pass to finish off a sweeping move just before the half-hour mark.
Porto regained control two minutes before half-time, though, when Galeno’s strike took a slight deflection and flew into the bottom corner.
Shakhtar’s hopes of progression were effectively ended in the 62nd minute when Galeno played in Mehdi Taremi who hammered a left-footed strike into the top corner to give Porto a two-goal cushion.
The visitors grabbed a second goal 17 minutes from time when Sikan’s shot was saved by Porto goalkeeper Diogo Costa, but the ball rebounded off an unfortunate Stephen Eustaquio and into his own net.
Porto’s 40-year-old centre-back Pepe extended his record for oldest Champions League goalscorer by stabbing in from a corner and Francisco Conceicao added a fifth.
Shakhtar had the final say as they dropped into the Europa League with a fight, as 19-year-old Brazilian Eguinaldo netted just two minutes after coming on as a substitute.