Bradford Bulls 34 Wakefield 26
Keith Lulia scored twice as the Bulls secured a thrilling victory ahead of one of the most pivotal weeks in their recent history.
As the club battles to avoid entering administration, Mick Potter's players overcame several defensive lapses to eke out a victory which keeps their play-off hopes alive.
The Bulls were dominant during the early exchanges, pinning Wakefield back towards their own line before Elliott Whitehead arrived to touch down a short kick from Luke Gale.
Gale added the simplest of conversions from underneath the posts and soon after the Bulls struck again when John Bateman sent Lulia over.
Gale's conversion left Potter's men 12-0 up and in total control.
Soon after, though, Wakefield broke upfield to catch the Bulls cold before a typically well-timed offload from Ali Lauitiiti sent hooker Paul Aiton scampering clear.
Paul Sykes, who is enjoying a steady renaissance during his loan spell with the Wildcats, kicked the conversion to bring the visitors right back into the game.
Wakefield responded again five minutes later after a period of incessant pressure on the Bradford line as Ben Cockayne went over in the left corner.
They grabbed their third try in the 33rd minute when Tim Smith advanced forward at pace to wriggle past Tom Burgess' challenge and squeeze over the line from close range.
Sykes' second goal cut Bradford's lead to just two points and shortly before the break Agar's men led for the first time.
Another fine move cut the Bulls apart and Sykes' pass ushered replacement Frankie Mariano galloping clear from 20 metres.
The Bulls hit back to regain the lead in the 47th minute when Lulia showed brute strength and impressive pace to race clear.
Gale converted and that poured confidence into the Bulls as they began to dominate field position, but with 14 minutes remaining Wakefield drew level.
Mathers' pass found replacement Kyle Wood and his swift offload to his right found prop Kyle Amor arriving to crash over the line.
Sykes' conversion sailed between the posts to level the scores at 26-26.
Three minutes later, the Bulls regained the lead when a crafty kick by Gale was grounded by the outstanding Olivier Elima.
Gale's conversion put the hosts 32-26 ahead and he then kicked a penalty with eight minutes remaining to seal victory before being sinbinned late on for holding down.