A pulsating Carling Cup tie between Championship outfit Cardiff City and the Terriers ended with the hosts going through courtesy of two extra-time goals - but at one stage only a minute separated Lee Clark's side and the Third Round.
After trailing by two goals at the interval, a brace from striker Jordan Rhodes and a Danny Ward strike put Town in front going into the 89th minute - only for a late equaliser to send the game into extra time.
Town battled hard and created chances throughout, but in the end the Cardiff side scored two extra time goals to deny the Terriers - who could be proud of their fightback.
Town, in their Umbro change strip of red shirts, black shorts and white socks for the fourth time in competitive action, kicked off to start the game and they launched the first attack of note in the fourth minute. Donal McDermott found Lee Novak in the right channel with a superb slide-rule pass and the striker crossed low into the box at the first opportunity, but at the back post Danny Ward's shot was blocked well by a defender at the expense of a corner.
Cardiff were playing with Frenchman Rudy Gestede just behind the giant Jon Parkin and immediately an aerial battle was forming between the man nicknamed 'The Beast' and centre back Jamie McCombe.
The Terriers started the game on the front foot, pressing their hosts into their own half during the opening stages. Lee Novak was leading by example up front, pressing Cardiff goalkeeper Tom Heaton into several early kicking errors with his tireless work.
At the other end Gestede had Cardiff's first attempt at goal in the 12th minute - but his weak side-footed effort from 23 yards out was no trouble for Ian Bennett.
Young Cardiff midfielder Joe Ralls did better a minute later, playing a smart one-two with a colleague to get goal side of Tommy Miller and forcing Bennett to dive to his left to gather in his shot from the edge of the box.
GOAL - The Championship side took the lead in the 16th minute with a straight forward set-piece from the right side, given away when Peter Clarke barged into the back of Parkin. Scottish international midfielder Craig Conway played a curling ball into the penalty area, where centre back Gabor Gyepes rose unchallenged to power a header inside the near post.
GOAL - Cardiff extended their lead with a quick-fire second barely a minute later, with striker Jon Parkin netting another expertly taken header. This time the cross came from open play down the Town right, with Parkin diverting a great header off the inside of Ian Bennett's left-hand post from the edge of the box - giving the veteran goalkeeper no chance despite his full-length dive.
Town tried to fight back three minutes after conceding the second, but Tommy Miller could only a his 25 yard volley straight at the goalkeeper after some decent build-up play.
Despite falling behind, Lee Clark's side looked dangerous going forward. Donal McDermott found Jordan Rhodes with a great through-ball that split the Cardiff defence in the 25th minute of the game, but unfortunately Gyepes managed to get back alongside last season's top scorer and snuffed out the opportunity.
SUB - Town looked to be forced into their first substitution in the 26th minute, with former Cardiff striker Alan Lee replacing Novak in attack. Novak looked to be describing a slight knock to the management as he left the field of play.
Parkin's movement up front for the Blues was causing issues - he was a constant target for his teammates and was pulling onto the smallest of the Town back four, Gary Naysmith. His lay-off on the half hour mark fell perfectly for Cowie to try his luck from range, but once again Bennett easily collected the ball.
At the other end Alan Lee was winning everything, but Cardiff's high line was frequently catching the Town attackers offside.
Winger Conway was a quality operator and he want close to creating a third for his side in the 36th minute. A run right across the Town backline got him in behind the defence to collect a pass down the right channel and striker Gestede was inches away from converting his low cross, with the ball narrowly evading his outstretched leg.
Parkin blasted wide soon after before sending another chance over, having rounded McCombe with a deft first touch on the edge of the box.
Town had a number of opportunities from a variety of free-kicks and corners during the final five minutes of the half, but Cardiff defended them well and had their own chance in the closing minutes when Conway ran straight at McCombe and forced Ian Bennett into another save, this time to his right side.
HALF-TIME: CARDIFF CITY 2 HUDDERSFIELD TOWN 0
No changes were made by either side at the interval and skipper Peter Clarke had to be alert early on to deny the lively Conway an early shot at goal with a brilliant last ditch tackle.
At the other end Danny Ward went on his first real dribble of the game, skinning right back Quinn down the left side before crossing to the near post. Jordan Rhodes had got in front of his man, but could only prod the ball wide with his outstretched boot when a header may have been the better option.
Tommy Miller then chipped a free-kick into the area after Lee had won a free-kick for his side, and the big striker was inches away from getting on the end of a flick-on from McCombe at the back post.
Ward and McDermott switched wings soon after as the Terriers continued to search for a way back into the game.
GOAL - They found that lifeline in the 54th minute when Jordan Rhodes netted a clinical third of the season. The striker pressed Cardiff captain Quinn hard in possession and the defender panicked, kicking the ball against Rhodes' shins; Jordan speedily ran into the area to collect the rebound and shaped to square the ball across the face of goal - but instead placed the ball past the 'keeper from an extremely acute angle.
As Town went for an equaliser gaps started to appear in the backline, and danger-man Conway almost exploited one in the 58th minute - firing the ball just inches wide of the back post from an acute angle on the right flank.
Rhodes' goal had blown the game wide open - and spurred the travelling faithful into good voice at the end Town were attacking. Hunt and Robinson both delivered dangerous crosses into the area from the right, but Cardiff defended them well once again.
SUB - Town made their second change in the 61st minute, with Oscar Gobern replacing Anton Robinson in central midfield.
Gary Naysmith was immediately needed at the other end to clear Conway's back post effort off the line before Parkin's shot was deflected over the bar moments later.
SUB - Cardiff made their first substitution in the 64th minute, with goalscorer Parkin replaced by Scotland international Kenny Miller.
SUB - Donal McDermott was replaced by Gary Roberts in Town's final substitution in the 68th minute. This change saw 'Robbo' take up residence on the left flank, with Danny Ward switching permanently to the right side.
GOAL - Townimmediately completed their comeback from two goals down two minutes later when Danny Ward scored his second of the season. Ward started the attack with a long range piledriver that the goalkeeper fisted away to the right side; Hunt collected and crossed to the near post, but once again the ball was cleared. Oscar Gobern stepped up 30 yards out and hit a good volley back towards goal, but another block presented the ball to Ward's feet inside the area. Danny stopped it, span and sent a low right-footed shot into the far corner of the goal - giving the 'keeper no chance.
Substitute Miller immediately tried to restore Cardiff's lead but was stopped in his tracks by McCombe before Alan Lee ran at the defence and sent an attempted curler straight into the goalie's hands.
The momentum of the game had swung in Town's favour, and all of a sudden the Terriers were winning every second ball. However, the Championship side had some very talented attackers and only a fantastic diving header from skipper Peter Clarke denied substitute Miller a clear headed chance at goal in the 76th minute. From the resulting corner, Israeli defender Keinan headed straight at Bennett at the back post.
Goalscorer Ward then uncharacteristically blazed over the bar after cutting in from the right on a promising Town counter-attack with 11 minutes left, after Jack Hunt had made a vital interception at the other end only moments before.
SUB - Cardiff made another substitution in the 81st minute, with youngster Joe Ralls replaced by Peter Whittingham.
Another Conway snapshot found the gloves of Bennett soon after before a superb last ditch tackle from left back Lee Naylor denied Rhodes a certain second of the game at the other end on the stroke of the 83rd minute after a loose ball fell to him inside the area.
SUB - Cardiff's final sub came in the 86th minute, with Andy Taylor replacing Naylor in defence.
GOAL - Town then scored a dramatic third goal in the 88th minute, with Cardiff amazed that the flag didn't come for offside. Impressive substitute Oscar Gobern chested down the ball in midfield before playing a neat one-two and dinking a through-ball past the defence for Jordan Rhodes; with Cardiff hoping for an offside call the striker advanced on the goalkeeper and waited until the final moment to slip the ball between the goalkeeper and the near post.
Set-piece specialist Whittingham sent a 25-yard effort wide of the far post in the closing moments of normal time before Lee blasted a Roberts cross wide at the back post in the first of the three added minutes.
GOAL - Unfortunately for Town there was still time for Cardiff to launch an attack - and Don Cowie netted a late header to send the tie into extra time. Again the supplier was impressive winger Conway, who stepped inside from his left flank to curl an in-swinging cross to the back post - where his fellow Scottish international climbed to head the ball into the far post in inch-perfect fashion.
90 MINUTES - CARDIFF CITY 3 HUDDERSFIELD TOWN 3
After a short interval play resumed for the first quarter of an hour of extra time, with Town kicking-off for the fifth time in the game. Conway tested Bennett from range once again in the early stages before Miller faired similarly, firing a snapshot straight into Benno's waiting hands.
BOOKING - Alan Lee was shown the first yellow card of the game in the 94th minute, apparently for dissent given that Tommy Miller had given away a foul.
GOAL - Cardiff retook the lead in the 96th minute, with the ever dangerous Craig Conway the scorer. The Scotsman picked up a pass on the halfway line and was allowed to advance to the edge of the box unchallenged, where he struck a shot towards goal; Peter Clarke had just stepped out to block the shot - but his leg only succeeded in deflecting the ball past the diving Ian Bennett and into the Town net.
BOOKING - Jack Hunt was shown Town's second yellow card in the 98th minute for an illegal barge on Conway as Cardiff tried to break.
Miller hit the post after playing a one-two to get goal side of Jamie McCombe in the closing couple of minutes of the first 15 minutes.
When the second half of extra time began, Jordan Rhodes looked certain to covert Danny Ward's left wing cross at close range - only for centre back Gyepes to deny him with a superb last ditch interception.
Ward blasted a free-kick miles wide of goal following a foul on Alan Lee at the far edge of the penalty area.
BOOKING - Darcy Blake was shown the first Cardiff yellow in the 112th minute for a foul on Lee.
Cardiff striker Gestede fired over in a rare counter attack for the home side as the final five minutes approached.
GOAL - Cardiff killed off the tie with a goal in the 117th minute of the game, with Don Cowie netting his second. Gary Naysmith had done brilliantly to deny Miller a certain goal with a last ditch goal-line clearance after Ian Bennett's superb initial save from the Scotland man, but when Miller collected the rebound and played it across the face of goal the midfielder ran onto the ball and smashed it into the far corner.
There was still time for Alan Lee to head over Jack Hunt's late cross at the back post, but there was no way back for the Terriers.
FULL-TIME: CARDIFF CITY 5 HUDDERSFIELD TOWN 3
Town's Team (4-4-2):
Ian Bennett; Gary Naysmith, Peter Clarke (c), Jamie McCombe, Jack Hunt; Danny Ward, Tommy Miller, Anton Robinson (Oscar Gobern 61), Donal McDermott (Gary Roberts 68); Jordan Rhodes, Lee Novak (Alan Lee 26)
Unused subs: Nick Colgan, Antony Kay, Liam Cooper, Scott Arfield
Town bookings: Alan Lee (94), Jack Hunt (98)
Cardiff booking: Darcy Blake (112)