Last-gasp Moses header pinches Chelsea win
The Ukrainian champions, who had been unbeaten in 18 matches in all competitions this season, seemed set for a well-deserved point at Stamford Bridge when Moses rose unmarked at a corner to score.
The goal immediately transformed Chelsea's chances of qualifying for the knockout round, moving the Londoners on to seven points in Group E - the same as Shakhtar. Juventus (six) follow with FC Nordsjaelland on one with two games remaining.
"I think in terms of the timing of the goal you could agree there was an element of luck because it was the last action of the game but when you get a win against such a good team as them you deserve it," Chelsea manager Roberto Di Matteo said.
"It was a game we needed to win and we achieved that under a lot of pressure. We need to get something out of our last games now."
Shakhtar coach Mircea Lucescu said he did not think his team deserved to lose and was angry with goalkeeper Andriy Pyatov for the mistakes that cost them dearly.
"It was a pity that today we unfortunately had a goalkeeper who made some mistakes and that cost us.
"He knew what to do on the last goal... he knew very well what I asked him to do before the game. I told him to stay within the six metres.
"He forgot at the last moment. I am very angry it was a lack of concentration and lack of experience, something went there."
Shakhtar had looked the better team for long periods with midfielder Willian running the match with an inspired performance as he scored both of Shakhtar's goals and left Chelsea's players trailing in his wake.
Chelsea started without the injured Ashley Cole and Frank Lampard and with John Terry on the bench because Di Matteo did not think he was match fit after his four-match domestic suspension.
Despite that, they got off to a good start when Fernando Torres scored after six minutes.
The Spain striker profited from the first of the mistakes by Pyatov, who dithered with a clearance and kicked the ball straight at Torres, who charged it down sending the ball into the net.
Shakhtar were level three minutes later when Willian side-footed home from close range after Fernandinho made a powerful run through the fragile left side of Chelsea's defence where youngster Ryan Bertrand had a torrid time.
Fernandinho tore into the open space and cut back for Willian who slotted in from close range off goalkeeper Petr Cech.
Shakhtar then took control with Willian, Henrik Mkhitaryan and Alex Teixeira putting Chelsea under continuous pressure and they almost went ahead with a superb move that ended in Teixeira firing narrowly wide.
However, all their hard work was undone five minutes before half-time when Oscar took advantage of another Pyatov error to score into an unguarded net from long range.
The goalkeeper, out of his penalty area, for some reason decided to head the ball instead of kicking it. The header went straight to Oscar, who fired a perfectly struck 35-metre shot over Pyatov's head and into the net.
Shakhtar levelled again two minutes after the break when Willian planted the ball home after another excellent build-up involving Fernandinho and Darijo Srna, the Shakhtar captain.
Razvan Rat then hit the bar for Shakhtar but they escaped at the other end when John Obi Mikel had a header disallowed when he drifted offside.
Di Matteo sent on Moses for Oscar with 10 minutes to play and with the last