Wakefield completed their first engage Super League double of the campaign with a hard-earned win over Catalans Dragons.
Two tries before the break and a third from Jamie Rooney in the 51st minute appeared to have put the Wildcats on course for a convincing victory at Belle Vue.
But centre Jon Wilson scored his second try of the match on the back of concerted Catalans pressure and Thomas Bosc converted to ensure a nervous finish for the home side.
And the last 10 minutes were very tense, packed with errors from both sides in worsening conditions as both teams battled for the winning try.
A try stalemate ensued, but Wakefield made the game safe in the final seconds with a 35-metre penalty from Rooney.
Wildcats recovered after conceding a try in the fourth minute to lead 10-6 at half-time with two tries in six minutes around the half-hour mark.
Wakefield, joint top of Super League in March but now deep in the relegation fight, were caught cold early on after a short kick from Luke Quigley.
Centre Wilson was alert to the kick, and he darted through to touch down and winger Bosc then converted.
Play swung from end to end before, in the 26th minute, the Wildcats replied to that early setback.
Half-back Ben Jeffries fired out the ball and skipper Jason Demetriou burst between defenders for the try. Rooney converted to level the scores.
And six minutes later home winger Waine Pryce pounced on an error on halfway.
Bosc tried to pass the ball inside, Demetriou knocked it backwards and Pryce picked up before haring half the length of the field to score in the corner.
Rooney touched down early in the second half to put the home side in a strong position and seemingly on course for the win.
But then Wilson scored his second try and Bosc converted.
Neither side was able to add another try but Rooney's late penalty ensured victory for the hosts.