Hugo Rodallega headed a dramatic 79th-minute winner to secure Wigan's Barclays Premier League status for another season on a dramatic day at the Britannia Stadium.
Rodallega's goal coupled with results elsewhere meant Roberto Martinez's men, who started the day second from bottom, would extend their top-flight status.
Rodallega met a Mohamed Diame cross to flick the winner past Asmir Begovic and spark wild scenes in front of the visiting supporters in the South Stand.
Just five minutes earlier the Latics had risen from their slumber after news filtered through of a goal at Old Trafford which lifted them out of the bottom three for the first time.
The visitors' dramatic survival was in sharp contrast to a dismal first half display, with Wigan looking nervy from the first minute when Ali Al-Habsi had to save from Kenwyne Jones.
Despite looking distinctly dodgy when dealing with set-plays, Al-Habsi would play a big part in keeping his side in with a chance during a torrid first half.
The visitors never came close to threatening Begovic's goal and it was the home side who pressed forward with the purpose of a side most concerned about the outcome.
Maynor Figueroa had to boot clear from deep in his own six-yard box before Wigan had a half-chance on 10 minutes, Diame firing wide from long-range.
Stoke had the ball in the net in the 11th minute when Jones' header from a Rory Delap long throw was helped in by Jonathan Walters, who was well offside.
These were worrying times for the visitors, with Stoke dominating possession and Al-Habsi looking far from comfortable when called to deal with Delap's long throws.
Stoke came even closer on 14 minutes when Jones prodded goalwards from another Delap throw and with Al-Habsi nowhere, Emmerson Boyce booted clear off the line.
Al-Habsi redeemed himself with a fine stop from a Jones drive in the 25th minute, but with Jermaine Pennant and Delap both continuing to fling crosses towards Jones, Wigan were struggling to get a grip.
Pennant dispossessed Diame and sparked a move also involving Walters which ended in Pennant striking a rising shot straight at Al-Habsi from the edge of the box.
Wigan looked brighter at the start of the second period, Diame wriggling through the Stoke rearguard and fashioning a shooting chance before being ruled offside.
Then an errant pass by Marc Wilson looked like letting in Hugo Rodallega 25 yards from goal only for Ryan Shawcross to get in with a crucial block.
Wigan striker Conor Sammon had his first chance in the 62nd minute when turned just inside the box and fired a low left-foot shot which was gathered by Begovic.
But Martinez sought to add new impetus to his strike-force in the 67th minute when he replaced the largely disappointing Sammon with Tom Cleverley.
Cleverley had Wigan's best chance with his first touch when he was sent through at a tight angle by Charles N'Zogbia but could only hit a low shot straight at Begovic.
Manchester United's third goal against Blackpool shunted the visitors towards safety and Rodallega ensured they took another giant stride with his superb 79th-minute finish.
The visiting fans, who had been virtually silent for long swathes of the afternoon, celebrated with Latics backroom staff but the game was far from over.
Urged on by boss Tony Pulis on the touchline, Stoke pushed for an equaliser with Glenn Whelan floating a free-kick inches over Al-Habsi's bar.
Five minutes of added time, including a loud penalty shout and Al-Habsi spilling a Delap corner, did nothing to settle Wigan nerves before the whistle ensured the celebrations could begin.Reuse content