After a fairly even opening, City went behind after just 14 minutes with the sort of goal you see once in a blue moon.
Ruben Dias’ pass was cut out on the halfway line by Luis Diaz who then set off on a run towards goal, cutting in from left to the and largely unchallenged before rounding Joao Cancelo and drilling a low shot past Ederson.
It was the lack of a meaningful attempt to dispossess the Colombian that will have concerned Pep Guardiola.
A quick response was needed, and it came courtesy of a rash challenge from 37-year-old Porto skipper Pepe.
VAR then took an age to decide the referee was correct before Aguero stepped up to squeeze a low shot under the keeper and into the bottom left corner.
Porto went close to regaining the lead not long before half-time with only a superb Kyle Walker clearance off the line preventing the Portuguese going ahead again.
Three City players were booked before the break with the visitors making the most of any tackles or challenges.
Porto, often with ten men behind the ball as City attacked, continued the frustrate the hosts until the 65th minute and it was Gundogan who was instrumental in winning the free-kick that he himself scored from, curling a beauty over the wall and into the top left corner.
It was just reward for City’s efforts against a disciplined, defensive-minded opponent.
Ferran Torres sealed victory seven minutes later with an equally eye-catching goal to seal a 3-1 win .