You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
A second-half own goal was enough for Juve to secure top spot in Group E and progress alongside Shakhtar, while Chelsea, winning for the first time under interim manager Rafael Benitez, are heading into the Europa League.
Galatasaray and Celtic claimed the other two knockout stage places decided in the final round of group matches.
Fernando Torres scored twice for Chelsea in an entertaining Stamford Bridge clash that featured three penalties, all awarded for handball and two of which were saved, in six first-half minutes.
Chelsea needed to win and hope Juventus lost, but the Italians ended Shakhtar's long unbeaten home run with Olexandr Kucher putting through his own net for the only goal on 56 minutes.
Barcelona's Lionel Messi was stretchered off with what appeared to be a serious knee injury near the end of the Group G winners' 0-0 draw at home to Benfica.
The Argentine World Player of the Year collapsed to the ground clutching his left knee after colliding with Benfica goalkeeper Artur.
Benfica were beaten to a knockout stage place by Celtic who beat Spartak Moscow 2-1 in Glasgow to finish two points ahead of the Lisbon club.
A penalty nine minutes from the end by Kris Commons put Celtic through to the last 16 for the first time since the 2007-08 season.
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 Manchester United.
The Turkish side denied Romania's CFR Cluj, whose consolation for an upset 1-0 victory over former champions United at Old Trafford, is a Europa League place.
Last season's beaten finalists Bayern Munich finished top of Group F after a 4-1 rout of BATE Borisov, finishing level on points with Valencia but with a better head-to-head record against the Spaniards who beat Lille 1-0 in France
Xherdan Shaqiri scored one and set up another for Bayern, who exacted revenge for a shock defeat in the reverse fixture in Belarus.