First-half goals from Brazilian pair Bernard and Ismaily stunned Pep Guardiola’s side on a freezing night at the Metalist Stadium in Kharkiv, with Sergio Aguero’s injury-time penalty too late to affect the outcome.
The result mattered little for City, with top place in the group already assured, but the tame end to their dazzling 20-game winning streak was hardly the ideal preparation for this weekend’s Manchester derby.
For Shakhtar the win prompted jubilant celebrations, with a place in the last 16 now secured. Their supporters can now look forward to seeing coach Paulo Fonseca fulfil a promise to wear a Zorro mask to a press conference if they qualified.
It was with Sunday’s clash with Manchester United in mind that City boss Pep Guardiola made seven changes. Among the players to come in were 17-year-old Phil Foden, for a full debut, and 20-year-old defender Tosin Adarabioyo.
Adarabioyo, who lined up on the right of a three-man back line with Eliaquim Mangala and Fernandinho, endured a tough start on only his second Champions League start.
Shakhtar’s motivation was obvious and in Brazilians Taison and Bernard they boasted plenty of attacking drive.
Bernard created the first serious opportunity after breaking down the right and evading a poor challenge from Adarabioyo. Fernandinho spared City by blocking Facundo Ferreyra’s shot.
Ederson then saved from Marlos but there was no denying Bernard after 26 minutes as he curled a brilliant shot over the City goalkeeper from just inside the box.
City’s plight immediately got worse as they conceded a second just six minutes later, again after being cut open all too easily.
Ederson, playing his usual sweeper-keeper role, paid the price for coming out of his area as Ismaily nicked the ball past him after latching onto a long ball from Taison. He calmly slotted home.
City began to show some positive signs as Leroy Sane made a good run down the right and Foden played Gabriel Jesus in on goal but Andriy Pyatov denied him a shooting chance. Ilkay Gundogan did connect with a powerful shot but Ivan Ordets blocked.
But Shakhtar continued to make most of the running, with Fred going close and Taison shooting narrowly over before and after the break.
City never looked like getting back into the game although Guardiola sent on Aguero in the hope of livening up his side and Jesus did clip the outside of the post before winning a last-gasp penalty.
Aguero stepped up to tuck home the spot-kick but time was almost up and there could be no late fightback.