Super-sub Andriy Yarmolenko scored a last-gasp winner to give West Ham's Premier League survival hopes a huge boost in a thrilling 3-2 victory over Chelsea at the London Stadium.
Introduced in the 78th minute for Jarrod Bowen, who had earlier set up goals for Tomas Soucek and Michail Antonio, Yarmolenko coolly slotted home at the end of a swift counter-attack to stun Chelsea.
The vital result lifts David Moyes' side three points above the relegation zone, while Chelsea – for whom Willian scored twice, including a stunning free-kick – missed the chance to climb to third.
It is the first time the Hammers, who won the reverse fixture 1-0, have done the league double over the Blues since the 2002-03 season, although they were somewhat ominously relegated in that campaign.
It had not shaped up to be a good night for the home side when Soucek was initially denied his first goal for the club, a lengthy VAR review finding the prone Antonio to be offside when the Czech forced home the loose ball from a corner.
The Hammers' woes were compounded when Issa Diop brought down Christian Pulisic in the area and Willian confidently converted the spot-kick.
But West Ham fought back and Slavia Prague loanee Soucek climbed above Cesar Azpilicueta to nod in the leveller from Bowen's corner.
Moyes' men took the lead when Bowen tricked his way into space and drove a low cross into the heart of the area, with Antonio on hand to provide the finish.
However, they could not hold on at 2-1 and Willian's cultured free-kick hit the inside of Lukasz Fabianski's left-hand upright before nestling in the net.
Remarkably, that was not the end of matters and, with the visitors pushing for a winner, the decisive goal came at the other end as Yarmolenko collected Antonio's pass before slotting in.
What does it mean? Hammers revived, Chelsea stunned
Frank Lampard's side have looked in fine form since the return from the coronavirus-enforced break, winning all three matches to reach the FA Cup semi-final and close the gap to third-place Leicester. West Ham, meanwhile, had lost back-to-back games without scoring.
But the form book went out of the window here, much to the Hammers' credit.
Moyes silences critics
Moyes has come in for significant criticism amid West Ham's struggles, but his side produced a display of which he can be proud. Even after the setbacks of Soucek's disallowed goal and then Willian's glorious equaliser, they showed huge character to dig deep and get the points.
Willian's a wizard
By netting in this game, albeit in a losing effort, Willian became the first player to score a Premier League goal in every calendar month. While the first strike may not make many highlight reels, though it was a solid spot-kick, his second was a thing of beauty.
Chelsea can do West Ham a favour by beating Watford on Saturday, while on Sunday Moyes' men head to a Newcastle United outfit buoyed by a dominant win over struggling Bournemouth.