Match ends, AFC Wimbledon 4, West Ham United 2.
West Ham manager Manuel Pellegrini said his side's defeat by AFC Wimbledon was a "disaster" as the League One side pulled off a stunning FA Cup shock to reach the fifth round.
The Dons, bottom of the third tier of English football, surged into a 3-0 lead against the Premier League side courtesy of Kwesi Appiah's deflected strike and Scott Wagstaff's double either side of half-time.
Pellegrini made a triple substitution at the break in an attempt to get back into the game and saw two of his changes - Lucas Perez and Felipe Anderson - score to make it 3-2.
But AFC Wimbledon, who were beaten 3-0 at home by Fleetwood in their last league game on Tuesday, continued to push men forward and put the seal on a famous victory courtesy of Toby Sibbick's late close-range header, sparking scenes of jubilation among the home crowd and leaving Pellegrini furious.
"Was I angry at half-time? Yes of course - I was ashamed of them," said Pellegrini.
"It's very easy to explain what happened - it was one team who wanted to win and another team who played without any desire or any ambition to win or continue in this cup.
"Maybe we thought we were going to win because we are a Premier League team and they are in League One, but Wimbledon played with the desire to compete in this cup. In the first 45 minutes, we didn't fight.
"It's very frustrating because you can be eliminated, but not in the way we were. It's a disaster."
- Live: Follow FA Cup fourth round
- Watch all FA Cup goals and highlights
- Arnautovic signs new West Ham deal
The Dons' positive approach rewarded with famous victory
AFC Wimbledon were playing in the fourth round of the FA Cup for the first time since they reformed in 2002, but this thoroughly deserved victory has created another piece of history that recalled the Crazy Gang spirit of Wimbledon's famous 1988 FA Cup final win over Liverpool.
The Dons are five points adrift at the foot of League One but belied their lowly league position by dominating West Ham for much of the game, particularly during the first half.
Terell Thomas had an early opportunity, but blazed over when well placed inside the box before Mitchell Pinnock's header was saved by goalkeeper Adrian.
But just as West Ham thought they had weathered the AFC Wimbledon storm, the home side took the lead.
Anthony Wordsworth's neat pass found Appiah and his effort from just outside the area deflected off Angelo Ogbonna and beyond a wrong-footed Adrian
AFC Wimbledon continued to press and their positive attitude was rewarded again shortly before the break.
Wagstaff stole the ball off Obiang in midfield before driving forward and finishing low into the corner.
You could understand if the Dons had then looked to defend and keep what they had, but instead they continued to push forward and went further ahead seconds after the restart courtesy of Wagstaff's neat flick from Appiah's cross.
Even when West Ham reduced the arrears to 3-2, AFC Wimbledon continued to push men forward and were rewarded when 19-year-old substitute Sibbick nodded home Wordsworth's teasing cross to seal the win.
Dylan Connolly - making his first AFC Wimbledon start since joining from Dundalk at the start of this month - symbolised their positive approach. The 23-year-old Irishman was a constant threat down the right flank and was deservedly given a standing ovation when he was substituted late on.
Manager Wally Downes, a former Wimbledon player in the 1980s, only returned to the club in December.
Hauling the club away from the foot of the table is likely to be his priority, but he now has the chance to create more FA Cup history 31 years after that famous afternoon at Wembley.
Sloppy West Ham slump to defeat
Speaking before the game, Pellegrini had urged his West Ham players to show a "winning mentality" to ensure they would not be the victim of a cup shock and named a strong starting line-up.
Marko Arnautovic, who has just signed a new contract, was a notable absentee, but there were starts for the likes of Andy Carroll, Javier Hernandez and Mark Noble.
However, the Hammers simply did not get going in the first half, failing to muster a shot on target.
Their only effort of note was a deflected Hernandez shot that clipped the outside of the post.
At the other end, Arthur Masuaku struggled to cope with AFC Wimbledon's attacks down the left while Obiang's error just before half-time allowed Wagstaff to score the home side's crucial second.
Pellegrini responded by making the triple substitution at the break, bringing on Perez, Anderson and Ryan Fredericks, only to see his side concede within a minute of the restart.
The Chilean looked exasperated on the touchline with his side seemingly out of answers, but they showed spirit to drag themselves back into the game thanks to two of Pellegrini's substitutes.
First Perez was alert to drive the ball into the corner after Michail Antonio's shot had been saved by Aaron Ramsdale.
Anderson then showed a touch of class to curl home a wonderful free-kick from just outside the area for his ninth goal of the season.
But the Hammers continued to look vulnerable at the back and they can have few complaints with the result, as they were eliminated by a League One side in the fourth round for a second successive year.
'I could have changed all the players' - what they said
AFC Wimbledon manager Wally Downes speaking to BT Sport: "I don't know if it was a plan, winning was the plan, not the 4-2.
"What was important was that they got over Tuesday's performance [3-0 home defeat by Fleetwood]. It was a great game to blow the cobwebs away and they did.
"Football is random. There is a load of analysis we do, me included, but on any given day, any team can beat any other team and we have done it tonight.
"They are a passing team but with Andy Carroll in the side they have to go direct and they may have got caught between the two. We knew it was important to stop Mark Noble getting the ball."
West Ham manager Manuel Pellegrini speaking to the club's official website: "I changed three players because I could only make three changes. I could have changed all the players. Unfortunately for us, they scored their third goal in the first or second minute of the second half, which made it very difficult.
"We talked before the game that this game happens a lot of time where the team in the lower division beats the team which is better because they play every ball as if it is their last ball of the game. We didn't have that attitude and when we could, we didn't try.
"The pace of the game, the way we fought for every ball and the way we made movements to receive the ball were disappointing. I changed three players because I could only make three changes. I could have changed all the players. Unfortunately for us, they scored their third goal in the first or second minute of the second half, which made it very difficult."
AFC Wimbledon create history - the stats
- AFC Wimbledon scored more than one goal in a single match in the FA Cup proper against a side from a higher division for the very first time in what was their 10th such contest since they reformed in 2002.
- It is also just the second time AFC Wimbledon have progressed from an FA Cup proper tie against a side from a higher division, and the first since they beat Scunthorpe United in a first-round replay in 2011-12.
- AFC Wimbledon's Scott Wagstaff scored his first-ever brace in professional football - he had scored just two goals in his last 44 appearances in all competitions before the win over West Ham.
- West Ham have been eliminated from the FA Cup by a League One side for a second consecutive campaign after Wigan beat them in 2018; it is the first time they have been knocked out of the competition by sides from a lower division in back-to-back tournaments since 1998-99 (Swansea City) and 1999-00 (Tranmere Rovers).
- West Ham have conceded four goals in a single FA Cup game against a side from the third tier or below for the first time since January 1936 when they lost 4-0 to Luton Town in a third-round replay.
- 16ConnollySubstituted forSibbickat 86'minutes
- 11PinnockSubstituted forSoaresat 65'minutes
- 9AppiahSubstituted forJervisat 76'minutes
- 26MasuakuBooked at 79mins
- 45DianganaSubstituted forFredericksat 45'minutesBooked at 67mins
- 14ObiangSubstituted forFelipe Andersonat 45'minutes
- 9CarrollSubstituted forPérezat 45'minutes
- 8Felipe Anderson
- Anthony Taylor
- Shots on Target
Second Half ends, AFC Wimbledon 4, West Ham United 2.
Attempt missed. Michail Antonio (West Ham United) left footed shot from the left side of the six yard box misses to the right. Assisted by Arthur Masuaku with a cross.
Attempt saved. Michail Antonio (West Ham United) right footed shot from the centre of the box is saved in the bottom left corner.
Arthur Masuaku (West Ham United) wins a free kick in the defensive half.
Foul by Anthony Wordsworth (AFC Wimbledon).
Goal! AFC Wimbledon 4, West Ham United 2. Toby Sibbick (AFC Wimbledon) header from very close range to the top right corner. Assisted by Anthony Wordsworth.
Attempt saved. Will Nightingale (AFC Wimbledon) header from the centre of the box is saved in the bottom left corner. Assisted by Anthony Wordsworth with a cross.
Corner, AFC Wimbledon. Conceded by Arthur Masuaku.
Delay over. They are ready to continue.
Substitution, AFC Wimbledon. Toby Sibbick replaces Dylan Connolly because of an injury.
Delay in match Dylan Connolly (AFC Wimbledon) because of an injury.
Attempt missed. Mark Noble (West Ham United) right footed shot from outside the box is too high. Assisted by Michail Antonio.
Attempt missed. Will Nightingale (AFC Wimbledon) right footed shot from outside the box is high and wide to the right. Assisted by Jake Jervis.
Issa Diop (West Ham United) wins a free kick in the defensive half.
Foul by Jake Jervis (AFC Wimbledon).
Foul by Ryan Fredericks (West Ham United).
Rod McDonald (AFC Wimbledon) wins a free kick in the defensive half.
Delay over. They are ready to continue.
Delay in match Adedeji Oshilaja (AFC Wimbledon) because of an injury.