West Ham's relegation from the Barclays Premier League was confirmed after they threw away a two-goal lead to lose 3-2 at Wigan, who ensured their own survival battle goes to the last day of the season thanks to Charles N'Zogbia's stoppage time winner.
The Hammers needed to win at the DW Stadium to stand any chance of beating the drop and were 2-0 up at half-time courtesy of Demba Ba's headers on 12 and 26 minutes.
The Latics stormed back after the break. N'Zogbia scored either side of a Conor Sammon strike, leaving Roberto Martinez's side in the bottom three on goal difference alone and sending the visitors down.
West Ham took the lead from a corner. Jack Collison's shot was blocked and the ball came out to Thomas Hitzlsperger, who crossed for Ba to head past Ali Al Habsi.
Wigan seemed to have regained the momentum - yet within moments were 2-0 down. Thomas Hitzlsperger's cross was headed back across goal by James Tomkins for Ba to nod in his second.
Latics then pulled themselves back into the game. Having been fouled by Tomkins, N'Zogbia stepped up to take the resulting free-kick himself and lashed it into the corner of the net, his fourth goal in five games.
Sammon then ran on to Ben Watson's pass, turned inside Danny Gabbidon and slotted home his first Wigan goal to level the scores.
The equaliser set up a frantic finale, with both sides desperately seeking a winning goal.
When Watson saw his low shot came back off the post and then Hammers goalkeeper Robert Green smother at his feet moments later, it seemed Wigan's chance for a precious victory was gone.
But N'Zogbia had the final say in the 94th minute, cutting into the box and slipping a shot under Green.