Liverpool are through to the knockout stages of the Champions League along with Tottenham Hotspur.
Liverpool are through to the last 16 of the Champions League with a 1-0 win over Napoli at Anfield.
Striker Mohamed Salah netted the winner in the 34th minute in front of a delirious home crowd.
Tottenham Hotspur also progressed with Lucas Moura scoring the all-important equaliser in a 1-1 draw with Barcelona at Nou Camp.
Spurs were aided by Inter Milan’s surprise 1-1 draw at home with Dutch club PSV Eindhoven.
Earlier, Porto struggled to a 3-2 away victory over Galatasaray in their final group match but the Turks stayed third in Group D and secured a spot in the Europa League’s round of 32.
Porto, who had already secured top spot in the group, took the lead against the run of play in the 17th minute with a well-timed Felipe header from a free kick.
Moussa Marega doubled the lead when he converted a 42nd-minute penalty, finding the net for the fifth successive group-stage match.
The hosts, who needed a win to make sure of third place, had failed to score in the competition since September but did break their goal drought with a penalty of their own from Sofiane Fenghouli in first-half stoppage time.
The Portuguese weathered a Turkish offensive early in the second half and restored their two-goal cushion when Marega pounced on a defensive mistake and Sergio Oliveira finished off a quick move.
The Turkish side reduced the deficit through Eren Derdiyok in the 65th minute and could have drawn level if Algeria international Feghouli had not hit the crossbar with his second penalty a minute later.
Lokomotiv Moscow were equally desperate for a win against already-qualified and injury-hit Schalke 04 to have any hope of snatching third place away from Galatasaray but went down 1-0 to a goal from Alessandro Schoepf.