Substitute Diafra Sakho ended City’s hopes of an FA Cup upset with a late winner for the only goal of an engaging tie at Ashton Gate.
The hosts were typically quick out of the blocks, as if partaking in no more than a run of the mill league fixture against fellow third tier opponents, pinning back their more illustrious visitors.
Matt Smith twice saw first-half headers cleared off the goal-line as City had West Ham on the ropes, but the longer the clock ticked by with the deadlock intact, the more the Premier League side looked like landing a knockout punch.
And sure enough it arrived nine minutes from time, as Sakho headed home an excellent Andy Carroll cross to send the Hammers into the last 16 of a competition they have realistic hopes of winning.
Steve Cotterill made two changes to his side victorious at Scunthorpe United last time out in rather more modest surroundings.
Mark Little returned in place of the cup-tied James Tavernier, while George Saville ran out in a City shirt for the first time to be greeted by a wave of noise as the home supporters swirled a sea of red and white scarves to create a raucous welcome.
Their heroes responded straight from the off, showing no signs of being overawed by their top-flight visitors.
It was the Premier League side who breathed the first sigh of relief as City were only denied a sixth minute opener by a goal-line clearance.
A typically devilish Luke Freeman corner was headed back across goal by Aden Flint and nodded back towards the far corner by Smith, who wheeled away to celebrate what looked a certain goal only for Mark Noble to head the ball to safety.
The speed of City’s counter-attacking would soon cause further problems for the Hammers.
Jay Emmanuel-Thomas was inches away from threading the ball through for Freeman. Mark Little was finding space at will down the City right. Freeman saw a shot take a looping deflection into the arms of Adrian when perhaps Emmanuel-Thomas was better placed.
Then another clear chance. Emmanuel-Thomas picked up possession in his favourite pocket of space but lost his footing before poking the ball out to Joe Bryan on the left.
From there Bryan was positive, driving at Carl Jenkinson and swapping passes with the recomposed figure of Emmanuel-Thomas only to drill a low shot so far wide it ultimately went behind for a West Ham throw-in, albeit from a rapidly diminishing angle.
There could be no doubt that City were the dominant side, and the visitors were on the ropes again from another Freeman corner midway through the first half.
This time the midfielder took the kick short to Emmanuel-Thomas, whose floated cross towards the back post was headed goalwards by Smith, who again beat Adrian but not the covering defender – this time Carroll – who bailed his team out with an acrobatic clearance.
West Ham, seventh in the Premier League and only four points off a Champions League spot, had offered remarkably little going forward.
The lack of threat was best captured by Carroll’s scuffed volley dragged well wide of the near post – an awkward combination of ambitious and lethargic not befitting a striker in form.
But the England frontman looked far more at home when he wrestled his way in front of Luke Ayling to meet Jenkinson’s right-wing cross seven minutes before the interval, as the defender did just enough to prevent a more powerful connection from Carroll, who prodded into the gloves of Frank Fielding for his first and only save of a very encouraging opening period.
There was not quite the same intensity about the action immediately after the break, as West Ham strived to establish a degree of control.
But even after 11 minutes of a far more composed second half from the visitors’ point of view, Sam Allardyce was the first manager to blink with a double change, withdrawing two internationals for two more, as Morgan Amalfitano and Sakho replaced the well below par Alex Song and ineffective Enner Valencia.
The Hammers’ best piece of play soon followed, as Stewart Downing glided past Korey Smith and played a neat one-two with Carroll on the edge of the box before blazing a shot high over the crossbar under pressure from the sliding Ayling.
Still there was little to choose between the sides, although City’s early dominance was certainly a thing of the past, but Matt Smith kept the home fans believing when he climbed above Winston Reid to meet a Bryan cross only to send his header into the building site behind Adrian’s goal.
City attacks were becoming increasingly sporadic, but you sensed West Ham were only just getting started.
Substitute Sakho, boasting nine goals in 12 starts since arriving from French club Metz, showed his class to cheekily lift the ball over the head of Ayling and run around the defender before rifling the bouncing ball against the top of the crossbar.
It was a rare moment of quality in a game seemingly petering out towards a replay until Sakho pounced nine minutes from time.
Much of the credit must go to the previously subdued Carroll, who showed his strength to hold off Derrick Williams and dig out a brilliant right-footed cross for his strike partner to convert at the back post with a header that found the net via the underside of the crossbar from four yards.
It was tough luck on City, who never looked inferior throughout a tie that showcased the strides made by Cotterill’s men to the watching millions.