Click on the links for full reports, ratings and man-of-the-matches
Chelsea's 6-1 rout of Nordsjaelland at Stamford Bridge handed beleaguered interim manager Rafael Benitez some respite but it came with the unwanted distinction of becoming the first Champions League holders to exit at the group stage.
A second-half own goal was enough for Juventus to secure top spot in Group E and progress to the knockout stage alongside Shakhtar.
Last season's beaten finalists Bayern Munich finished top of Group F after a 4-1 rout of BATE Borisov, ending level on points with Valencia but with a better head-to-head record against the Spaniards.
Valencia beat Lille 1-0 in France but had to make do with second spot, while Lille finished bottom with just three points.
Benfica, who began the night level on points with Celtic, could not find the breakthrough they needed in a 0-0 draw away against below-strength Barcelona, who had already topped the group.
Celtic struck a blow for Scottish football by reaching the last 16 for the first time since the 2007-08 season thanks to a 2-1 home victory over Spartak Moscow which secured runners-up spot in Group G.
Brazilian Luis Alberto's fine 55th-minute strike gave Cluj a 1-0 win at already-confirmed group-winners Manchester United to seal a Europa League place.
Second-half goals from Burak Yilmaz and Aydin Yilmaz helped Galatasaray come from behind to win 2-1 at Braga and go through as Group H runners-up behind United.
A Paris Saint-Germain & Porto
B Schalke 04 & Arsenal
C Malaga & Milan
D Borussia Dortmund & Real Madrid
E Juventus & Shakhtar Donetsk
F Bayern Munich & Valencia
G Barcelona & Celtic
H Manchester United & Galatasaray
Draw is on December 20 at 10:30 GMT