Fernando Torres rediscovered his goal-scoring touch too late for Chelsea's Champions League hopes on Wednesday, with the English side becoming the first holders to exit at the group stage despite a 6-1 thrashing of FC Nordsjaelland.
Instead Juventus advanced to the knockout stages with a 1-0 victory at Shakhtar Donetsk, who also qualified from Group E, at the expense of Rafael Benitez' side.
The Italian champions only had to avoid defeat to progress, and an own goal by Shakhtar defender Olexander Kucher from Juventus right back Stephan Lichtsteiner's low cross into the box in the 56th minute made sure of qualification.
Juventus finished with 12 points, two more than Shakhtar and Chelsea. The Ukrainian club went through due to a better head-to-head record. The Blues will instead play in the Europa League.
On a bittersweet night for Chelsea, Torres ended a month-long goal drought by scoring twice in a match for the first time this season.
Chelsea went ahead in a frenzied spell in which both sides missed penalties before David Luiz scored from the spot in the 39th minute. Torres netted in first-half stoppage time.
Although Joshua John pulled one back for Nordsjaelland 20 seconds after the break, Gary Cahill began Chelsea's second-half goal spree with a header. Torres drove in his second before Juan Mata and Oscar added goals.
There was more fortune for Scottish club Celtic though.
Kris Commons smashed home a controversial late penalty to earn Celtic a 2-1 victory over Spartak Moscow and a place in the Champions League's knockout stage for the first time since 2008.
The Scottish champions started the match level on points with Benfica in Group G but leapfrogged the Portuguese side, who could only draw 0-0 at Barcelona in the final round of group matches.
With the match standing at 0-0 after 81 minutes, Celtic were heading out of the competition, only for Giorgos Samaras to fall easily under the challenge of Kirill Kombarov.
When Commons' penalty went in off the crossbar the Celtic fans went wild as they celebrated a surprising qualification from one of the hardest groups.
Lionel Messi was carried off on a stretcher with an apparent knee injury as Barcelona were held to a draw at Camp Nou.
Messi, who went on as a reserve in the 58th minute, collided with Benfica goalkeeper Artur in the 85th and was in obvious pain from his left knee.
Messi is only one goal short of tying Gurd Mueller's 40-year-old record for most goals in a calendar year.
Benfica looked the sharper side in the first half, while Barcelona dominated in the second. Barcelona had already qualified for the knockout phase.
A late goal by Aydin Yilmaz gave Galatasaray a 2-1 win over Braga and sent the Turkish club into the Champions League knockout stage for the first time in 11 years.
Galatasaray were level on points with Cluj going into the last Group H games and needed a win in Portugal to beat the Romanian club to second place and advance behind group winners Manchester United.
Cluj's 1-0 victory over United was in vein as the Turkish club had a head-to-head advantage that sent the Romanian team into the Europa League.
Braga finished bottom of the group with three points and are out of European football.
Jonas scored from the penalty spot as Valencia won 1-0 away to Lille, although it was not enough to guarantee top spot in Group F because Bayern Munich also produced a win.
Bayern, who thrashed BATE Borisov 4-1, finished top of the group because of a superior head-to-head record with Valencia - beating the Spanish club at home and drawing away.