Veteran striker Aaron Wilbraham scored an 88th-minute winner as Bolton came from behind to preserve their Sky Bet Championship status with a dramatic 3-2 triumph over Nottingham Forest at the Macron Stadium.
Wanderers were heading back to League One after just one season when Forest struck twice in nine minutes to lead 2-1 with three minutes of normal time remaining.
But defender David Wheater and then 38-year-old Wilbraham struck to complete a remarkable great escape for Phil Parkinson's side.
With fellow strugglers Barnsley losing at Derby and Burton beaten at Preston, Wanderers' survival was confirmed.
Bolton knew though only victory would be enough to beat the drop and they were in deep trouble after goals from Ben Osborn and Jack Colback overturned Adam Le Fondre's 67th-minute opener.
At that point Wanderers' third relegation in six years beckoned.
But instead the Trotters found a way to dig themselves out of their plight thanks to Wilbraham's winner after he had missed a series of chances.
Forest, with only one defeat in their four previous games, certainly contributed to a gripping game.
They should have been in front with one of two first-half chances wasted by striker Ben Brereton before Wanderers got into their stride.
But if Brereton was profligate, it was nothing compared to Wilbraham's wastefulness in front of goal. He spurned a hat-trick of chances in the opening 45 minutes, including one header that hit the post.
When he did find the back of the net, a raised linesman's flag signalled more disappointment.
Forest also struck the woodwork through Joe Lolley who also headed over as chances continued to be created and spurned.
Busy referee Scott Duncan booked two players apiece from each side in the first half including Danny Fox for a touchline altercation with Wanderers boss Parkinson.
Bolton were forced to change goalkeepers at half-time with Mark Howard replacing Ben Alnwick.
VOTE: EFL Goals of the Month
Watch and Vote for your favourite April goals in the Sky Bet Championship, League One and League Two here...
Wanderers continued to pepper Kapino's goal with a two-on-one opportunity shortly after Le Fondre's introduction for skipper Darren Pratley.
Kapino saved from Wilbraham, and Little smashed a shot over the crossbar.
Wilbraham put another header wide of the target before Le Fondre rifled in a loose ball from 10 yards for his seventh goal of the season.
But the joy turned to despair three minutes later as Osborn picked up a loose ball and fired an angled left-foot shot into the bottom corner with Howard slow to react.
Osborn then turned provider for Colback to give the visitors the lead. Bolton, who had not scored three times since the first month of the season, simply refused to give up.
Wheater side-footed home for an equaliser before Wilbraham headed in a Le Fondre cross for the winner, to spark jubilant scenes among the home supporters
Phil Parkinson: "It was just a dream. Last season we got promoted but this was more tense. There was no fall-back this time. Last year we had the fall-back of the play-offs. We knew if we lost we were down. It has been tough, but when it really mattered most we produced a performance to keep us in the division.
"This does feel better because of the magnitude of what we have been up against. When you are losing and down at the bottom all the time and fighting for our lives it has been tough to keep the morale high on the training ground. This is right up there with my best achievements."
Aitor Karanka: "When the opponent needs to play with everything as they are playing for their lives, and they do, it makes the difference."