Foden struck in the seventh minute but it was not an entirely comfortable night for Pep Guardiola's side until the England forward made it 2-0 in the 74th minute.
Kevin De Bruyne gave the scoreline an emphatic look with a sublime finish from 25 metres although it was harsh on Bristol City who had been on a 12-match unbeaten run.
Leicester were booed off after a 2-1 home defeat by second-tier Blackburn Rovers for whom Tyrhys Dolan and Sammie Szmodics were on target before a Kelechi Iheanacho reply.
Fulham reached the sixth round for the first time in 13 years with superb goals by Joao Palhinha and Manor Solomon earning them a 2-0 win over fellow top-flight side Leeds United.
Brighton and Hove Albion's hopes of a first ever major trophy remained intact as Evan Ferguson's first-half goal sealed a 1-0 win over second-tier Stoke City.