Joao Palhinha's 43rd-minute goal fired Tottenham to Premier League safety with a 1-0 home win over Everton.
Defeat at Chelsea on Tuesday meant Spurs required a draw or victory to guarantee survival and ensure West Ham's result at home to Leeds had no bearing on the north London club's destiny.
Even though Roberto De Zerbi had sparked an incredible turnaround for Tottenham since his March arrival and guided them out of the bottom four last month, his next magic trick was to end a 10-match winless run at home in the Premier League.
Palhinha's scruffy goal two minutes before half-time earned Spurs a deserved lead at the break, but a nervy second half followed with news of West Ham goals filtering through.
Everton boss David Moyes shuffled his pack and substitute Tyrique George almost produced a last-gasp leveller, but Antonin Kinsky's flying save in stoppage-time confirmed a first Tottenham home league win since December and sent West Ham down.
It meant West Ham's final-day win over Leeds was too little too late.
The Hammers needed a victory and for Tottenham to lose at home to Everton to stay up and send Spurs down instead.
They kept their side of the bargain as second-half goals from Taty Castellanos, Jarrod Bowen and Callum Wilson sank Leeds 3-0.
But Spurs, who had very sportingly been bad enough to take the relegation scrap to the last day, got their win to survive by two points.
It brought to an end West Ham's 15-year stay in the top flight, with relegation coming a decade after the controversial move to the London Stadium and the hollow promises from the owners that came with it.
Their brief revival under Nuno Espirito Santo, who replaced Graham Potter as manager in September, began too late and fizzled out too early.
"We sold our soul, for this ****hole" rang around the former Olympic Stadium as fans turned their anger towards chairman David Sullivan.
The Leeds fans were in no mood to be sympathetic, chanting "Millwall away ole ole", a fixture which could keep the Metropolitan Police busy next season.
Relegation will come as no surprise to seasoned West Ham watchers, with the club having been in decline ever since David Moyes took them to Conference League glory in 2023.
Supporters will point to the sale of Declan Rice to Arsenal and subsequent dismal investment of his £105m transfer fee.
West Ham cherry-picked cheap players from relegated clubs; James Ward-Prowse, Kyle Walker-Peters and Mateus Fernandes from Southampton, Crysencio Summerville from Leeds and Mads Hermansen from Leicester.
Now, the same will happen to them, with Bowen, Summerville and Fernandes likely first out of the door.