Rangi Chase inspired Castleford to victory over Bradford, who saw their slim hopes of reaching the Super League play-offs come to an end.
England international Chase scored one try and was involved in five others.
Kirk Dixon, Adam Milner, Justin Carney, Jordan Tansey and Nathan Massey also crossed for the hosts.
Bradford scored through Jarrod Sammut twice, Brett Kearney, Nick Scruton, Danny Addy and Elliot Kear, but a late charge was halted by Jamie Ellis's try.
The Bulls came within six points of the hosts late on, but Francis Cummins's side will miss out on the play-offs for the fifth successive year, having needed to win all three of their remaining games to stand a chance of catching Hull FC or Hull KR, who are both six points clear.
Stand-off Chase, possibly finishing his Castleford career with a flourish ahead of an expected move to Salford, was instrumental for his side as England coach Steve McNamara looked on.
Bradford started well, Mannut touching down for the 17th time this season after collecting Manase Manuokafoa's offload, but Cas blew the visitors away with three tries in 10 minutes.
The 2011 Man of Steel Chase was involved in all three, kicking over the top for Dixon to score, combining with Grant Millington to set up Milner and freeing Michael Shenton, who laid it on for Carney to finish.
Castleford saw Charlie Martin sin-binned and Kearney and Scruton scored for Bradford either side of a Tigers try for Milner.
But Chase was at it again, selling a series of dummies before bursting over the line and then turning provider with a kick for Tansey to touch down.
Bulls threatened a fightback when Sammut, Kear and Addy went over with only Massey landing a Castleford reply.
The home side held firm though and Ellis finished off the last move of the match to ease the nerves.
Castleford coach Daryl Powell:
"We don't do anything easy. It was a crazy game. It took an amazing tackle under the posts to keep them out at the end.
"Getting Charlie Martin sin-binned made it very difficult for us. We were clinging on at the end. Thankfully we were able to do it.
"We showed a fair bit of character to dig a win out when we could have folded."
Wakefield coach Francis Cummins:
"We've had opportunities to win games this year that we've probably thrown away.
"We needed bit of luck in keeping people fresh and we've not had it. I am frustrated but we have to take it on board and improve.
"We're a young group and we will get better. We will be in a stronger position next year, both on and off the field.
"We're investing in staff, we've a lot of good people coming in and it's going to be a great place."
Castleford: Tansey, Clare, Shenton, Dixon, Carney, Chase, Ellis, Boyle, Milner, Huby, Millington, Hauraki, Massey
Replacements: Owen, Clark, Fleming, Martin
Bradford: Kearney, Kear, Purtell, Lulia, Foster, Sammut, Addy, Scruton, Diskin, Manuokafoa, Olbison, Blythe, Walker
Replacements: Langley, Donaldson, O'Brien, Evans