The Ukrainian side will be joining City in Monday’s draw for the last 16 as the victory confirms their runners-up spot ahead of Napoli.
Shakhtar captain Taison blasted an early 25-yard effort over the bar and Fernandinho had to make a fine block to stop Facundo Ferreyra getting a shot in on goal as the Ukrainian side started the clash well.
Ederson then had to save Marlos’ left-footed shot before Shakhtar deservedly took the lead in the 26th minute with an outstanding individual effort by Bernard who curled a right-footed strike past the City goalkeeper after good work by Marlos.
The home team doubled their lead seven minutes later when Ederson came racing out of his area in an attempt to get to Marlos’ pass only for Ismaily to beat him to the ball and then roll it into an empty net.
City finally launched several attacks just before the interval with Phil Foden, Gabriel Jesus and Ilkay Gundogan all going close to halving the deficit.
Pep Guardiola’s team started the second period very brightly and Leroy Sane’s volley was well held by Andriy Pyatov before Fernandinho headed wide from a good position.
Jesus hit the post after good work by Brahim Diaz before Sergio Aguero scored from the penalty spot in stoppage time after Jesus had been brought down.
However, City will now turn their attention towards Sunday’s Manchester derby at Old Trafford.
Northampton striker Kevin van Veen is hoping to make his first start in over a month in the home game against Shrewsbury.
Derby's decision to postpone Sunday's home Sky Bet Championship game against Cardiff was made independently, Derbyshire Police have confirmed.
Rochdale have no new injury worries ahead of Tuesday's Sky Bet League One relegation battle with fellow strugglers Fleetwood.