Pep Guardiola survived an early scare to remain on course for possible success on three fronts in his debut season at Manchester City, booking a place in the FA Cup quarter-finals where they will visit Middlesbrough.

The evening was not without moments of anxiety but two goals from Sergio Aguero, his first in seven domestic appearances for City, were one of many plusses for the City coach who will have to rely on the Argentinian heavily over the remaining months of the campaign given the absence of the injured Gabriel Jesus.

City settled the tie with a devastating spell that brought three goals in eight minutes after the half-hour mark although the anxiety prior to that blitz had been palpable.

Huddersfield, indeed, had the audacity to take the lead, through a seventh minute effort from former City academy player Harry Bunn, a goal which yet again highlighted the weaknesses in the home team’s goalkeeping and defence.

Harry Bunn handed the visitors a shock lead (Getty)

First, Philip Billing was allowed too much space to advance the ball deep into the City half, eventually finding Bunn, via a touch from Collin Quaner, whose low finish passed through the legs of goalkeeper Claudio Bravo.

The Chilean’s debut season at the Etihad has been one to forget, his first team place having effectively been passed to Willy Caballero, and by the time he made an unconvincing save to keep out Jack Payne’s 43rd minute shot, the home crowd greeted him with sarcastic jeers.

Fortunately for those supporters, by that stage the tie was over thanks to a devastating attacking performance from Guardiola’s team.

Leroy Sane had already struck the post, cutting in from the left and striking a lethal shot against the right-hand upright, by the time City fell behind.

And before they equalised, there were strong claims for a pair of City penalties as Jon Stankovic, not once but twice, appeared to stop shots with his hand.

Fernandinho tries to flick the ball past Dean Whitehead (Getty)

However, there was no debate about the clinical manner of the equaliser, scored on 30 minutes, as Kevin De Bruyne switched play from left to right wing and Raheem Sterling crossed low through the six-yard area and Sane tapped in.

Four minutes later City succeeded with a third penalty appeal after Pablo Zabaleta’s chip into the area saw Stankovic wrestle Nicolas Otamendi to the ground.

Aguero strode up and nonchalantly converted his 21st goal of the season past Joel Coleman from the resulting penalty.

The forward was soon played clean through and should have claimed goal number 22 only for his finish to strike the same post hit by Sane earlier in the game.

But after 38 minutes Aguero was heavily involved in City’s third after his shot was parried well by Coleman and the Argentinian responded quickly to square the rebound for Zabaleta to shoot home.

Leroy Sane is foiled by goalkeeper Joel Coleman (Getty)

The fact that David Wagner, watching from the stands as he served the first of a two-game FA suspension, had made nine changes from his last league selection indicated that the Huddersfield manager’s thoughts were more on Saturday’s Championship encounter with leaders Newcastle.

And the scoreline should have looked even uglier for him soon after the restart when Aguero launched a devastating counter-attack half the length of the field before slipping through a pass for Sane who miscontrolled.

Huddersfield regained a foothold impressively to demonstrate the depth Wagner has in his squad with Quaner dispossessing De Bruyne just inside the City half and sprinting into the area before his shot was deflected behind.

Joe Lolley headed just over, from a well-worked short corner, while Quaner appealed for a penalty after contact with John Stones.

Pablo Zabaleta grabs his side's third goal (Getty)

But with the tie long since decided, it was a question of the two teams winding down towards full-time. De Bruyne was denied by the keeper from a 20-yard free-kick before Aguero scored his second, and City’s fourth, after 73 minutes.

Zabaleta sent Sterling away down the right and the England forward’s cross was met by Aguero who clinically swept the ball in from six yards with the minimum of effort.

Substitute Kelechi 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.

Man City: Bravo; Zabaleta, Otamendi, Stones, Clichy; Fernandinho, Garcia; Sterling, De Bruyne (Delph 74 mins), Sane (Navas 81 mins); Aguero (Iheanacho 78). Substitutes (not used) Caballero, Sagna, Fernando, Silva.

Huddersfield: Coleman; Cranie, Hudson, Stankovic, Holmes-Dennis; Whitehead, Billing (Hogg 67 mins); Lolley (Smith 61 mins), Payne, Bunn (van La Parra 54 mins); Quaner.