Peter Mata'utia's drop-goal in the seventh minute of extra-time clinched a first-ever Super League golden point victory for Castleford Tigers at the Mend-A-Hose Jungle as they edged out Huddersfield Giants 27-26.
The win looked unlikely when Joe Wardle came back to haunt the Tigers with a try four minutes from time as Huddersfield opened up a six-point lead.
But Cas produced one last big effort to level the game through Grant Millington's try on his 200th appearance for the club and Mata'utia's seventh goal.
Into extra-time Cas missed two great chances to win it with drop-goals before they finally sealed victory in the second minute of the second half of overtime with Mata'utia's effort after a brilliant set had given him the position to land the one-pointer.
Defeat was tough on Huddersfield's Lee Gaskell who raced over for a hat-trick of tries, but it showed that the Tigers had learned from previous experiences when they had lost close games earlier in the season.
In dank conditions it shaped up to be a game of attrition and Cas set their stall out with some early forward charges before taking their chance to open the scoring with a Peter Mata'utia penalty goal.
Daniel Smith was held up over the line as a strong attack was narrowly halted and Jordan Rankin's grubber kick was well followed up to force a goalline drop-out.
Another penalty was kicked by Mata'utia from 40 metres out to make it 4-0 on 21 minutes.
But Huddersfield's first serious attack brought them points as Lee Gaskell - who has starred on this ground before - forced his way over from close range and Oliver Russell added the conversion.
An action replay seven minutes later saw Gaskell collect his second try and Russell's second goal made it 12-4.
The Tigers were given some hope, however, just before half-time when Mata'utia's grubber kick was dropped on over the line by Greg Minikin. With Mata'utia adding an excellent touchline conversion there were just two points in it at the break.
Huddersfield came close to scoring early in the second half with Paul Clough held up over the line and Jermaine McGillvary knocking on trying to get to a grubber over the line.
Rankin was tackled just short at the other end on the last tackle after his high kick had been batted back to him by James Clare.
More Giants pressure came to nothing with the home defence fronting up better before a penalty gave Mata'utia a chance to put another two points on the board for Cas to level things up.
The Tigers defence cracked, however, on 56 minutes with Gaskell finishing via a smart dummy after a move that had a suspicion of obstruction about it at the start of the build up.
Russell's conversion put the visitors six points up, but back came Cas to level again as Liam Watts went over from close range and Mata'utia goaled.
Mata'utia then kicked another penalty to inch the Tigers 20-18 in front.
They spurned a drop-goal chance with McShane tackled on the line on a solo charge instead of passing and were quickly made to pay for it.
Russell's brilliant 40-20 kick gave the Giants good field position from which Joe Wardle charged over from close range.
Russell's goal looked to have sealed victory for the Giants, but the Tigers were not quite done as a visiting player failed to deal with a grubber kick and Millington dropped on the ball to the delight of the home fans.
Mata'utia's kick squared the game up and took the game into extra-time.
Mistakes from both sides made for an enthralling golden point finish until match winner Mata'utia came up with his so important drop-goal.
Scorers - Castleford: Tries Minikin, Watts, MIllington; goals Mata'utia 7; drop-goal Mata'utia. Huddersfield: Tries Gaskell 3, Joe Wardle; goals Russell 5.
Castleford Tigers: Mata'utia; Clare, Minikin, Blair, Eden; Rankin, Trueman; Watts, McShane, Smith, Clarkson, McMeeken, Massey. Subs: Millington, Milner, Cook, Clark
Huddersfield Giants:McIntosh; McGillvary, Turner, Jacob Wardle, Senior; Gaskell, Russell; English, O'Brien, Matagi, Joe Wardle, Mellor, Murphy. Subs: Leeming, Clough, Lawrence, Ta'ai
Referee: Ben Thaler