Leroy Sane, Pablo Zabaleta and Kelechi Iheanacho also scored for Pep Guardiola’s side.
Leroy Sane, Pablo Zabaleta and Kelechi Iheanacho also scored for Pep Guardiola’s side who booked a place in the last eight of the competition, where they will travel to take on Premier League rivals Middlesbrough.
However, City were forced to respond to an early scare after the visitors, who made nine changes with an eye on their efforts to win promotion to the Premier League, took the lead through Harry Bunn.
City finally gained a foothold with Sane’s equaliser on the half hour, took the lead four minutes later from Aguero’s penalty and made it three goals in eight minutes via Zabaleta.
Despite making nine changes from their last league performance, Huddersfield took a surprise lead with just seven minutes gone after year another disastrous example of City’s defending and goalkeeping.
Philip Billing was allowed to make a long run deep into the home half before his pass was touched by Collin Quaner into the path of Bunn whose drive went through the legs of recalled keeper Claudio Bravo.
City had already struck the post, after Sane cut in from the left and struck a thunderous effort against the right-hand upright.
And after falling behind, the only surprise was that it took until the 30th minute for the Premier League side to equalise.
Joel Coleman gathered Kevin De Bruyne’s powerful free-kick at the second attempt and City felt they should have had a penalty when Jon Stankovic appeared to handle a De Bruyne effort soon after.
There was yet another penalty appeal, again for a Stankovic hand, after Raheem Sterling’s cross struck the defender.
But, on the half hour, the appeals did not matter after De Bruyne’s cross found Sterling on the right and the England forward’s low centre handed Sane the simple task of tapping the ball over the line from point-blank range.
Four minutes later, City finally received the penalty decision they wanted when Zabaleta chipped the ball into the area, Stankovic wrestled Nicolas Otamendi to the ground and Aguero nonchalantly stroked in his 21st goal of the season from the spot.
Aguero hit the post three minutes later having been played clean through on goal but it took only until the 38th minute for the replay to be all but settled.
Aguero’s near-post shot was well parried by goalkeeper Coleman but the Argentinian had the presence of mind to react and centre for Zabaleta to finish easily.
There were still problems at the back for City and Bravo made an unconvincing stop to deny Jack Payne’s shot before the interval at the expense of a corner, leading to sarcastic applause from the home support.
Huddersfield manager David Wagner, watching from the stands as he served the first of a two-match FA ban, clearly had more interest in his team’s Championship meeting with leaders Newcastle on Saturday.
And the tie could have turned even uglier for him soon after the restart when Aguero launched a devastating counter-attack the length of the field and played through Sane whose first touch for once let him down.
Huddersfield responded with Quaner robbing the ball from De Bruyne just inside the City half and advancing before having a shot deflected behind, Joe Lolley headed over from a well-worked short corner and Quaner appealed for a penalty after a challenge from John Stones.
But City were coasting towards the finishing line and always looked capable of adding to their tally, something they did through Aguero in the 73rd minute after Zabaleta sent Sterling sprinting down the right.
The forward’s cross was met by Aguero, six yards out, whose lethal, first-time finish gave Coleman no chance in the Huddersfield goal.
Substitute Iheanacho wrapped up the scoring in injury-time with a similar goal as Zabaleta’s pass to Jesus Navas was crossed for the Nigerian to score from six yards.