The Blues, who went into the game unbeaten in 28 games, were much-changed against the Ukrainian champions with several key players rested ahead of the Manchester derby.
Two goals in six first-half minutes effectively ended the contest - a match that marked Pep Guardiola’s 100th Champions League game.
Sergio Aguero scored a late consolation from the penalty spot.
Guardiola made seven changes from the side that beat West Ham at the weekend, handing a full debut to 17-year-old Phil Foden.
The City boss had been at pains to explain he would make changes, but would still be selecting a team that was more than capable of winning in the Ukraine.
With an unusual-looking defensive formation that included Fernandinho at the centre and Foden as a left wing-back, the Blues dominated the early possession without threatening the hosts’ defence.
Little happened in the way of goalmouth action, save for one scramble in the City box in the opening minutes.
The first shot on target resulted in the opening goal of the game on 26 minutes as Bernard cut inside Danilo to curl a beauty over Ederson's outstretched glove and into the top right-hand corner.
It had been coming with the host starting to dominate and look dangerous every time they attacked.
Shakhtar quickly doubled their lead six minutes later with a goal that was the result of some uncharacteristically sloppy City defending.
Marlos breached the Blues’ high defensive line with a clever pass over the top that Ismaily ran clear on to and he then nicked it past the advancing Ederson before rolling the ball into the empty net.
City were on the ropes, but still should have halved the deficit just before the break as Foden sent a lovely through pass that set Gabriel Jesus clear, but he was tackled by Pyatov as he attempted to go around the Donetsk keeper.
The Blues were sprightlier after the break but Bernardo and Fernandinho spurned presentable opportunities to reduce the arrears and Jesus struck the post on 77 minutes after great work by impressive Brahim Diaz.
Jesus was brought down in the box in added time and Aguero halved the deficit from the penalty spot with his 12th goal of the campaign, but there wasn’t enough time to find an equaliser as City’s superb run finally came to an end.
Star man: Phil Foden
The youngster never stopped working and didn’t let anyone down with a display of promise from a position he won’t have played in too often.
What does it mean?
City’s long unbeaten run may be over but the result doesn’t affect the standings in Group F as Shakhtar are confirmed as runners-up behind the Blues who lost their first game in 29 matches and also saw the 20-game winning streak end.
City face Manchester United at Old Trafford on Sunday afternoon in the Premier League’s biggest game of the season so far.
The Blues then travel to South Wales to face Swansea City at The Liberty Stadium.
Stats and milestones
Foden became the youngest Englishman to start at Champions League game.
Gabriel Jesus has suffered a defeat in a competitive game for the first time in more than 13 months for Club and country.