A towering stoppage-time header from Manuel Friedrich made it a week to forget for Andre Villas-Boas and Chelsea, Bayer Leverkusen winning 2-1.
The Blues had taken the lead through Didier Drogba early in the second half but Eren Derdiyok equalised.
It seemed that a draw was on the cards before Friedrich's intervention, meaning Chelsea need to avoid defeat or secure a score draw against Valencia to progress.
Bayer had the best of the first half, with only Daniel Sturridge providing any creative impetus for the Blues, but Chelsea still had the best chance to score on 38 minutes.
Sturridge played in Drogba but the Ivorian ballooned the ball over after nipping past Bernd Leno.
The veteran striker made up for his miss straight after the break, however.
Sturridge played another fine ball into the path of Drogba and the 33-year-old turned past Friedrich before drilling a low shot past Leno.
Chelsea fans expecting the floodgates to open were disappointed as former midfielder Michael Ballack spurned two chances to equalise - the second a fine stop by Petr Cech - and the home side had a deserved lead when substitute Derdiyok's looping header found the back of the net.
Drogba had a viable penalty claim turned down shortly afterwards when he went down under Friedrich, but nothing was awarded, and Chelsea were made to pay when Friedrich rose the highest at a last minute corner and bulleted the header home.