Alex Mellor grabbed a hat-trick of tries as Huddersfield claimed their fourth Betfred Super League win of the season with a thrilling 20-18 home triumph over third-placed Castleford.
The in-form back-row forward scored once in the first half and twice in the second in a West Yorkshire derby in which the lead changed hands six times.
The first half proved to be the tightest of affairs, with the Tigers holding a narrow 8-6 interval advantage.
Both teams crossed for one converted try each, while video referee Robert Hicks ruled out potential scores for Huddersfield's Lee Gaskell and Jermaine McGillvary and Castleford's Mike McMeeken.
The difference at the break proved to be a 21st-minute penalty from half-back Peter Mata'utia as the visitors made it clear they were prepared to grind the contest out.
However, it looked as if it might be a different story early on as former Giants winger Greg Eden easily intercepted a loose pass from Kruise Leeming to stroll in from halfway after two minutes, with Mata'utia adding the extras.
Castleford's initial enthusiasm was somewhat dampened with the immediate loss of prop Grant Millington to injury.
And by the 13th minute the hosts had drawn level when Gaskell glided through the opposition defence and fed the supporting Mellor to finish off. Darnell McIntosh made no mistake with the straight-forward conversion.
With both teams having the chance to add to their tryscoring tally in the second quarter, the game hung tantalisingly in the balance at the start of the second period.
But within a minute of the restart the Giants - and Mellor - struck for a second time when Leeming and Matt Frawley combined to put the second-rower over from close range, with McIntosh converting to put his side ahead for the first time.
It proved to be shortlived, though.
Just five minutes later and seconds after the Giants had been placed on a team warning for conceding several quick-fire penalties, Matt Cook crashed over by the posts from a tap, with Mata'utia nudging his side back ahead with the conversion.
All of a sudden, the tightest of tussles was opening up and smart play from Frawley paved the way for McIntosh to bang over a 52nd-minute penalty to level the scores again, before the full-back landed his fourth goal of the night with a second successful penalty six minutes later.
Great Tigers defence then denied Joe Wardle and Akuila Uate, and their rearguard efforts were rewarded when Mata'utia slotted over a 40m penalty to make it 16-16 with 17 minutes remaining.
And the Castleford full-back followed up with his fifth two-pointer just minutes later as the exchange of lead continued.
The evening's pattern of events kept going in the 69th minute as McIntosh and McGillvary worked in tandem to hand Mellor his treble, although this time the conversion failed, making it 20-18.
On Huddersfield's next attack Gaskell was denied a try for a second time by video referee Hicks to keep Castleford in the contest.
In a nail-biting finale, the Tigers twice forced their hosts to drop-out from under their own posts, while amazing goal-line defence somehow prevented Adam Milner from crossing, with the hooker's frustration at missing out boiling over and handing him a spell in the sin-bin as a result.