Wakefield pulled off the great escape on a night of high drama to condemn neighbours Castleford to relegation for the second time in three years.
The Wildcats were 8-1 on with the bookmakers to go down when John Kear took over the reins two months ago but their heart-stopping win in a match worth £1million to the victors was their fourth in six matches as they reached the target set by the coach with the midas touch.
The eagerly-awaited clash, played in front of 11,000 fans shoe-horned into Belle Vue and others perched on rooftops overlooking the famous ground, lived up to all expectations.
It was every bit as close as expected, with Wakefield just about deserving their success after holding their nerve and ending Castleford's brave resistance with two tries in the last 15 minutes.
It was a sad way for Castleford captain Danny Nutley to bow out of the English game while assistant coach Brad Davis found himself on the losing side on a last-day decider for the second time.
The Tigers were the pre-season relegation favourites but they went into the biggest game in their recent history game needing a point to secure their future and for long periods they looked capable of achieving it.
Jamie Rooney kicked the home side into an early lead after Castleford forward Richard Fletcher had been penalised for a high tackle on Wakefield scrum-half Ben Jeffries.
But it was the visitors who scored the first try of an action-packed first half, with second rower Willie Manu pouncing on a Danny Brough grubber kick after defender David Solomona had been slow to react.
Brough made it 6-2 with the conversion but there was a touch of controversy when Jeffries slipped a tackle from Danny Ward and went 70 metres to the line only to have the try disallowed by video referee Ian Ollerton for obstruction in back play.
It looked a harsh call but at least Wakefield were spared further punishment when Brough missed his kick at goal from the resultant penalty.
However, the decision looked an even bigger call five minutes later when Tigers full-back Michael Platt cut a great swathe through the heart of the home side's defence.
He was eventually stopped but defenders were still retreating when winger Adam Fletcher went from acting half and sprinted 30 metres to the corner for a second Castleford try.
Brough was again wide with the goal attempt but increased his side's lead to 11-2 with a drop goal before Wakefield struck back with two tries in the last 10 minutes of the half, despite the loss of full-back Colum Halpenny with concussion.
An offload by substitute forward Ben Catic was hacked sideways by Monty Betham straight into the hands of centre James Evans, who was left with an unopposed run to the line.
Rooney added the goal and almost grabbed a try following another neat offload from Catic but the pass went to ground.
Wakefield kept up the pressure, however, and regained the lead three minutes before the break when club captain Jason Demetriou demonstrated remarkable strength and fortitude to brush off a series of attempted tackles and reach the line.
Rooney maintained his 100 per cent record with the boot to give his side a three-point lead but it was anybody's game.
There were more signs of nerves at the start of the second half, with Semi Tadulala (Wakefield) and Deon Bird (Castleford) both fumbling the ball on the first tackle.
But there was no let-up in the action as the lead changed hands twice more within 11 minutes of the re-start.
First Castleford captain Danny Nutley took a pass from dummy half Andy Henderson to crash over for only his third try for the club in his final match.
Brough's goal made it 17-14 but Wakefield quickly made their way upfield and their captain Monty Betham took Sam Obst's pass to bounce off the tackle of Luke Dyer to touch down despite the hint of a double movement.
Rooney's fourth goal restored the Wildcats' three-point lead as the game entered a dramatic final quarter.
Castleford sent on 38-year-old Davis in one last bid for glory and winger Ryan McGoldrick reached the line only to be held up on his back.
That proved to be the Tigers' last chance as the Wildcats took full advantage of a knock-on by Gray Viane to set up the all-important score, centre Kevin Henderson taking Solomona's pass to cross at the corner.
Rooney was off target for the first time but Trinity had a seven-point cushion, which became eight when Rooney coolly slotted over a drop goal.
And the Wildcats piled on the misery for their neighbours when Evans grabbed his second try after Rooney's high kick deceived Dyer with a wicked bounce.