Bristol City produced an FA Cup upset as 10-man West Ham were beaten 1-0 in a third-round replay at Ashton Gate.
Tommy Conway’s equaliser at the London Stadium nine days earlier had set up this return tie and the 21-year-old striker was the Robins’ hero again as his early goal proved the difference.
West Ham, sixth in the Premier League, suffered further misery as Said Benrahma was sent off after 51 minutes for reacting stupidly to a strong challenge from Joe Williams.
Bristol City, 14th in the Sky Bet Championship, will again meet top-flight opposition in the fourth round should Nottingham Forest successfully negotiate their replay at Blackpool on Wednesday.
West Ham boss David Moyes was short on attacking options with Jarrod Bowen, Lucas Paqueta and Michail Antonio injured and Ghana’s Mohammed Kudus away at the Africa Cup of Nations.
Danny Ings, strongly linked with a move to Wolves this January, started for the first time since November alongside Benrahma and Maxwel Cornet.
West Ham were down on numbers and three current academy players occupied a bench one short of taking up its full allocation of nine substitutes.
Bristol City began with nine of the side that started the 1-1 draw in East London and Conway was on the scoresheet again inside three minutes after West Ham had wasted a golden opening – Cornet overhitting a pass with Ings clean through.
The action immediately switched to the other end where Konstantinos Mavropanos’ mistake allowed Conway to round Lukasz Fabianski and make light of a tight angle by rolling the ball home.
Anis Mehmeti sent a 20-yard effort over but the Hammers gradually asserted authority with Max O’Leary’s goal coming under increasing threat.
Ings was off target from the edge of the box, Mavropanos failed to connect with James Ward-Prowse’s free-kick when contact would surely have levelled matters and Cornet was denied by a last-gasp Cameron Pring challenge.
Cornet, making only his second start of the season, underlined his rustiness further by miskicking in front of goal, while Pring was vigilant to turn away Ings’ effort close to the line.
Bristol City had defended for most of the half, but the hosts burst into life in the final minute.
Mehmeti’s low effort tested Fabianski at his near post and the veteran goalkeeper was called upon from the resulting corner to gather Ross McCrorie’s header.
Life got a lot more difficult within six minutes of the restart when Benrahma kicked out at Williams after being fouled.
Referee Darren England took his time to decide the punishment as Benrahma received treatment, but the Algerian was eventually banished when back on his feet.
Tempers boiled over again as Taylor Gardner-Hickman and Aaron Cresswell were booked after grappling with each other.
West Ham almost equalised after Ings and Emerson combined and Cornet crossed for Tomas Soucek to force O’Leary into an excellent reflex stop from close range.
Substitute Nakhi Wells nearly doubled Bristol City’s lead, but the Robins held on for a famous victory and home fans celebrated as if they had won the cup itself.