Match ends, Tottenham Hotspur 1, West Ham United 2.
Two goals in the final 10 minutes saw West Ham come back to beat managerless Tottenham and book a Capital One Cup semi-final tie with Manchester City.
Spurs took the lead in the second half when Emmanuel Adebayor scored his first goal since May with a superb volley.
The Hammers levelled when Matt Taylor found Matt Jarvis on the left side of the area and he smashed home.
Five minutes from time substitute Modibo Maiga grabbed the winner when he headed in from Mohamed Diame's cross.
It was a stunning end to a match that only came alive in the 67th minute when Adebayor, who had previously only played 45 minutes of club football this season, crashed home a spectacular opener.
The Portuguese's temporary replacement, Tim Sherwood, will be hoping luck changes for his side on Sunday when they travel to Southampton - but this defeat will be a difficult one to recover from.
It all started well for the hosts, with three chances in the first five minutes.
The first two came during one move when Gylfi Sigurdsson's shot was blocked and Jermain Defoe fired the follow-up a foot wide from about eight yards.
In the next attack, the marauding Andros Townsend, who later came off with what looked like a hamstring injury, ran 15 yards with the ball before firing in a low strike that went inches wide.
But Spurs hit a creative block for the rest of the half, with West Ham's disciplined defence easily reading their opponents' predictable final balls.
Although Sam Allardyce's men spent much of the half on the back foot, they did manage to test Hugo Lloris, on a rare foray forward, when he dived left to prevent Carlton Cole's strike from creeping in.
The first 20 minutes of the second half were forgettable bar a moment when James Collins attempted a lofted pass back to Lloris, after play was stopped for an injury, but instead nearly caught out the keeper.
It did finally improve as a spectacle with just over 20 minutes remaining when Adebayor launched himself at Defoe's cross and volleyed the ball in off the underside of the bar.
That woke the Hammers up, with the impressive Taylor launching a fierce drive that Lloris prevented from bursting the net.
They then equalised with a goal typical of an Allardyce-led team. Keeper Adrian launched a long punt downfield which was headed down to Taylor. The midfielder found Jarvis on his left and he scampered a couple of yards before firing home.
Five minutes later, the match turned on its head when Maiga, who came on for Cole in the 65th minute, scored his first goal for a year when he rose highest to head in Diame's delivery.
The Mali forward came close to adding a spectacular second in stoppage time, but saw his shot rebound back off the crossbar.
Check out the best photos from tonight's Capital One Cup ties on the BBC Sport Facebook page.
West Ham manager Sam Allardyce:
"As the game wore on both teams had to go for it. Neither of us wanted it to go into extra-time.
"It is what you can do when the spaces get bigger and bigger. We improved after Emmanuel Adebayor's goal.
"We saw the shaken nerve ends of Tottenham when we scored. We then went for the jugular. Our substitutes, who came on with fresh legs, exploited the spaces."
- 3RoseSubstituted forFryersat 62'minutes
- 22G Sigurdsson
- 10AdebayorBooked at 33minsSubstituted forHoltbyat 78'minutes
- 17TownsendSubstituted forChadliat 73'minutes
- 18DiarraBooked at 61minsSubstituted forMorrisonat 79'minutes
- 24ColeSubstituted forMaigaat 65'minutes
- 26ColeSubstituted forDiaméat 70'minutes
- Neil Swarbrick
- Shots on Target
Second Half ends, Tottenham Hotspur 1, West Ham United 2.
Attempt saved. Jack Collison (West Ham United) right footed shot from outside the box is saved in the centre of the goal.
Modibo Maiga (West Ham United) hits the bar with a left footed shot from outside the box.
Jermain Defoe (Tottenham Hotspur) wins a free kick on the left wing.
Foul by James Collins (West Ham United).
Attempt missed. Mohamed Diamé (West Ham United) right footed shot from a difficult angle on the right is close, but misses to the right. Assisted by Modibo Maiga with a headed pass following a set piece situation.
Foul by Mousa Dembélé (Tottenham Hotspur).
Mohamed Diamé (West Ham United) wins a free kick in the defensive half.
Attempt saved. Gylfi Sigurdsson (Tottenham Hotspur) right footed shot from the centre of the box is saved in the centre of the goal. Assisted by Mousa Dembélé.
Vlad Chiriches (Tottenham Hotspur) wins a free kick in the defensive half.
Foul by Modibo Maiga (West Ham United).
Foul by Etienne Capoue (Tottenham Hotspur).
George McCartney (West Ham United) wins a free kick in the defensive half.
Corner, Tottenham Hotspur. Conceded by Matthew Taylor.
Attempt missed. Gylfi Sigurdsson (Tottenham Hotspur) left footed shot from the centre of the box misses to the left. Assisted by Lewis Holtby with a cross following a corner.
Corner, Tottenham Hotspur. Conceded by James Collins.
Attempt blocked. Jermain Defoe (Tottenham Hotspur) right footed shot from outside the box is blocked. Assisted by Nacer Chadli.
Goal! Tottenham Hotspur 1, West Ham United 2. Modibo Maiga (West Ham United) header from the centre of the box to the bottom left corner. Assisted by Mohamed Diamé with a cross.
Attempt saved. Nacer Chadli (Tottenham Hotspur) right footed shot from the left side of the box is saved in the centre of the goal. Assisted by Jermain Defoe.