Arthur Masuaku scored a bizarre late winner as top-four hopefuls West Ham twice came from behind to beat Premier League leaders Chelsea in a pulsating encounter at London Stadium.
After collecting the ball wide on the left, Masuaku beat Chelsea goalkeeper Edouard Mendy at his near post with a left-footed cross-cum-shot to send the Hammers supporters into ecstasy.
Thiago Silva broke the deadlock for Chelsea in the first half, heading Mason Mount's corner past Lukasz Fabianski via the inside of the post.
West Ham equalised when Mendy brought down Jarrod Bowen following a poor backpass from Jorginho, allowing Manuel Lanzini to stroke home from the penalty spot.
Chelsea restored their advantage in spectacular fashion, Mount sending a superb side-footed volley into the corner from Hakim Ziyech's low cross for his second goal in two games.
Bowen's low drive from the edge of the area restored parity once more before Masuaku's remarkable 87th-minute winner.
The win consolidated West Ham's place in the top four, while Chelsea will drop to third if Manchester City and Liverpool win this weekend.
West Ham punish sloppy Chelsea
After saying Chelsea lacked "the right attitude" in their narrow victory at Watford on Wednesday, manager Thomas Tuchel will be bitterly disappointed at the manner in which they relinquished their grip on proceedings on Saturday.
They appeared in total control after Thiago's goal, only for Jorginho and Mendy to gift West Ham a route back into the game.
Mendy had enough time to clear the danger after beating Bowen to Jorginho's backpass, but he opted to take a touch before scything down the former Hull winger.
Mount's fabulous first-time strike put the Blues back in the driving seat shortly before half-time. The England midfielder, who delivered another impressive showing, has now been directly involved in eight goals in his past six league games.
Chelsea started the second period on the front foot too, but West Ham remained a threat on the counter and struck when Bowen was given time and space to get his shot away despite Thiago and Andreas Christensen being in close proximity.
There appeared little danger when full-back Masuaku - a first-half substitute for the injured Ben Johnson - collected the ball near the sideline, but he somehow managed to beat Mendy with a powerful drive to inflict a first away league defeat of the season on Chelsea.
Hammers tactics pay dividends
The win ended West Ham's run of three league games without a win since their magnificent 3-2 victory over Liverpool before the international break.
David Moyes' team, operating with a back three of Craig Dawson, Moussa Diop and Kurt Zouma, soaked up Chelsea's pressure before attempting to strike on the counter.
The impressive Bowen almost made it 3-2 moments before Masuaku's winner when he failed to steer Michail Antonio's low cross on target.
West Ham are now only six points behind Chelsea in the table and four ahead of Arsenal, who face Everton at Goodison Park on Monday.
Player of the match
BowenJarrod Bowen
West Ham United
Squad number20Player nameBowen
Squad number41Player nameRice
Squad number26Player nameMasuaku
Squad number10Player nameLanzini
Squad number28Player nameSoucek
Squad number9Player nameAntonio
Squad number5Player nameCoufal
Squad number4Player nameZouma
Squad number8Player nameFornals
Squad number22Player nameBenrahma
Squad number23Player nameDiop
Squad number15Player nameDawson
Squad number31Player nameJohnson
Squad number1Player nameFabianski
Chelsea
Squad number19Player nameMount
Squad number6Player nameThiago Silva
Squad number24Player nameJames
Squad number2Player nameRüdiger
Squad number12Player nameLoftus-Cheek
Squad number29Player nameHavertz
Squad number22Player nameZiyech
Squad number4Player nameChristensen
Squad number3Player nameAlonso
Squad number20Player nameHudson-Odoi
Squad number5Player nameJorginho
Squad number16Player nameMendy
Squad number10Player namePulisic
Squad number9Player nameLukaku
Line-ups
West Ham
Formation 3-4-2-1
1Fabianski
15Dawson4Zouma23Diop
5Coufal28Soucek41Rice31Johnson
20Bowen10Lanzini
9Antonio
1Fabianski15Dawson4ZoumaSubstituted forFornalsat 71'minutes23Diop5CoufalBooked at 90mins28Soucek41Rice31JohnsonSubstituted forMasuakuat 45+2'minutes20Bowen10LanziniSubstituted forBenrahmaat 85'minutes9AntonioSubstitutes
7Yarmolenko8Fornals11Vlasic13Areola16Noble22Benrahma26Masuaku33Král50AshbyChelsea
Formation 3-4-2-1
16Mendy
4Christensen6Thiago Silva2Rüdiger
24James12Loftus-Cheek5Jorginho3Alonso
22Ziyech19Mount
29Havertz
16Mendy4ChristensenBooked at 90mins6Thiago Silva2Rüdiger24JamesBooked at 90mins12Loftus-Cheek5JorginhoBooked at 23mins3AlonsoSubstituted forPulisicat 72'minutes22ZiyechSubstituted forHudson-Odoiat 64'minutes19Mount29HavertzSubstituted forLukakuat 45'minutesSubstitutes
1Arrizabalaga9Lukaku10Pulisic11Werner17Saúl18Barkley20Hudson-Odoi28Azpilicueta31SarrLive Text
Match ends, West Ham United 3, Chelsea 2.
Second Half ends, West Ham United 3, Chelsea 2.
Andreas Christensen (Chelsea) is shown the yellow card for a bad foul.
Foul by Andreas Christensen (Chelsea).
Michail Antonio (West Ham United) wins a free kick on the left wing.
Attempt missed. Christian Pulisic (Chelsea) header from the centre of the box misses to the left. Assisted by Mason Mount with a cross.
Reece James (Chelsea) is shown the yellow card for a bad foul.
Foul by Reece James (Chelsea).
Tomas Soucek (West Ham United) wins a free kick in the defensive half.
Vladimir Coufal (West Ham United) is shown the yellow card for a bad foul.
Callum Hudson-Odoi (Chelsea) wins a free kick on the left wing.
Foul by Vladimir Coufal (West Ham United).
Foul by Ruben Loftus-Cheek (Chelsea).
Saïd Benrahma (West Ham United) wins a free kick on the left wing.
Attempt missed. Jarrod Bowen (West Ham United) left footed shot from the right side of the box is too high. Assisted by Michail Antonio.
Goal! West Ham United 3, Chelsea 2. Arthur Masuaku (West Ham United) left footed shot from a difficult angle and long range on the left to the top left corner. Assisted by Michail Antonio with a headed pass.
Substitution, West Ham United. Saïd Benrahma replaces Manuel Lanzini.
Attempt missed. Romelu Lukaku (Chelsea) header from the centre of the box is just a bit too high. Assisted by Antonio Rüdiger with a cross.
Attempt blocked. Ruben Loftus-Cheek (Chelsea) header from the centre of the box is blocked. Assisted by Mason Mount with a cross.
Corner, Chelsea. Conceded by Issa Diop.
Our coverage of your Premier League club is bigger and better than ever before - here's everything you need to know to make sure you never miss a moment