Pep Guardiola’s side dispatched Wycombe Wanderers 6-1 at the Etihad Stadium on Tuesday and have been rewarded an away fixture against the Hammers, who avenged their Premier League defeat to Manchester United last Sunday by beating the Red Devils 1-0 at Old Trafford on Wednesday.
Chelsea beat Aston Villa on penalties following a 1-1 draw at Stamford Bridge on Wednesday. The Blues have been handed another home fixture in the next round against Southampton.
Arsenal are at home to Marcelo Bielsa’s Leeds United in another all-Premier League encounter. The Gunners defeated Wimbledon 3-0 on Wednesday.
Liverpool are away to Championship side Preston North End while Queens Park Rangers host Sunderland.
Leicester will host Brighton at the King Power Stadium and Burnley will welcome Tottenham Hotspurs to Turf Moor while Stoke City are at home to Brentford.
The games will be played on October 26 and 27.
Fourth-round draw in full
Chelsea v Southampton
Arsenal v Leeds
Stoke v Brentford
West Ham v Manchester City
Leicester v Brighton
Burnley v Tottenham
QPR v Sunderland
Preston v Liverpool