Chelsea conceded a late equaliser to draw 3-3 with Zenit Saint Petersburg and ruin their hopes of topping Group H on Wednesday night, with Juventus' victory over Malmo consigning them to second place and a likely tougher draw in the last 16.
The Blues made a lightning fast start and were ahead within 90 seconds when a Ross Barkley corner was flicked on by Andreas Christensen and into the path of Timo Werner, who tapped in on the line.
However, Chelsea's levels dropped soon after and though Mason Mount had an opportunity to double their lead, Zenit clawed back level when the dangerous Claudinho flicked in an excellent Douglas Santos cross.
Barely minutes later the hosts took the lead as Chelsea's defence parted in uncharacteristic fashion, allowing Sardar Azmoun to race through on goal, round Kepa Arrizabalaga and slotted into an empty net.
Thomas Tuchel's side managed to draw level in the second half courtesy of a lovely team move that culminated in Werner getting in behind Zenit's backline to square for Romelu Lukaku to make it 2-2.
The visitors looked like they had stolen all three points when Werner grabbed his second. The German created space for himself in the box from substitute Christian Pulisic's pass to smash in his second and his side's third.
However, Zenit grabbed a deserved point when Magomed Ozdoev smacked in a glorious half-volley from the edge of the box in stoppage time.
The result means Chelsea go through as runners up, meaning they will face a group winner in the last 16 - the draw will take place on Monday.
CHELSEA PLAYER RATINGS
1. Goalkeeper & defenders
Kepa Arrizabalaga (GK) - 6/10 - Made an important stop to prevent Chelsea going 3-1 down during a period where his defence just simply stopped defending. Another excellent saved stopped Azmoun's header going in. Got a flappy hand to the third goal but couldn't keep it out.
Cesar Azpilicueta (CB) - 6/10 - Read the game well, making some important interventions.
Andreas Christensen (CB) - 6/10 - Great flick at the near post to set up the opener. Should have been more commanding when the defence had a meltdown towards the end of the first half.
Malang Sarr (CB) - 4/10 - Looked all at sea once Chelsea lost control. Got a little bit better in the second half but won't be starting any big games any time soon.
2. Midfielders & wing backs
Callum Hudson-Odoi (RWB) - 5/10 - Went into the book for a late challenge on Douglas. Didn't make much of an impact.
Reece James (CM) - 6/10 - Interestingly placed in central midfield on his 22nd birthday. Displayed some nice touches when pressed.
Ross Barkley (CM) - 4/10 - Caught napping on the ball for Zenit's second. Couldn't influence proceedings positively and came off after an hour.
Saul Niguez (LWB) - 4/10 - Showed good awareness at one point to cut out a dangerous ball across goal, but the left side he shared with Sarr was a big issue for Chelsea all night. Produced some particularly aimless crosses.
Mason Mount (RW) - 7/10 - Took up good positions with some excellent movement. Should have put his side 2-0 with a decent chance in the first half.
Romelu Lukaku (ST) - 7/10 - Some rusty touches and turns thwarted a few good openings. Had the easy task of converting into an empty net from Werner's pass for his fifth goal of the season and his first since September against the same opposition.
Timo Werner (LW) - 8/10 - Right place at the right time to secure Chelsea's first of the night. Did well to get in behind Zenit's defence and provide Lukaku with the equaliser.
Christian Pulisic (RWB) - 7/10 - Provided the game winning assist by teeing up Werner.
Hakim Ziyech (AM) - 5/10
Kai Havertz (ST) - 5/10
Marcos Alonso (LWB) - 5/10