West Ham leapfrogged Liverpool into third and denied Jurgen Klopp's side a piece of club history with a stunning 3-2 victory.
Liverpool arrived at the London Stadium knowing that if they avoided defeat they would extend their unbeaten run to 26 matches, beating the club's all-time record set by Bob Paisley's team in 1982.
They looked on course to do just that following a wonderful free-kick from Trent Alexander-Arnold.
But West Ham mean business as well this season and proved it when Pablo Fornals, whose corner had been palmed in by Reds keeper Alisson for the opening goal, broke away to score a second.