Lloyd Dyer produced a stoppage-time stunner to stretch Leicester City's winning run to four matches.
Dyer's looping finish had a slice of luck about it as the Foxes hit back after losing a two-goal lead.
All five goals came in the second half and it seemed Leicester were heading for the three points when Matt Fryatt grabbed a brace to put them 2-0 up.
Huddersfield, though, battled back with two goals in eight minutes, only for Dyer to pounce in stoppage time.
The first half was even with Huddersfield having chances through Michael Flynn and Liam Dickinson.
Fryatt gave a taste of things to come when he was put through and kept his cool only for keeper Matt Glennon to come out to save.
Glennon then tipped over Fryatt's flick as the first half ended goalless with no indication of the drama to come.
Five minutes after the re-start Leicester went ahead when Nicky Adams put Fryatt through and the striker made no mistake.
Andy Butler missed a good chance to equalise when he headed wide before Leicester doubled their lead in the 65th minute from the penalty spot.
Dyer's driven cross struck Jim Goodwin's arm and Fryatt stepped up and fired home for his ninth goal of the campaign.
Huddersfield battled back as temperatures rose and Gary Roberts crashed home from close range in the 69th minute.
Steven Howard had an effort ruled out for offside and Flynn volleyed wide before the home side levelled when Dickinson headed home Goodwin's deep cross.
As the fourth official signalled three minutes of stoppage time it seemed like the points would be shared.
However, Leicester broke Huddersfield resistance again when Fryatt set up Dyer, whose finish looped up over Glennon.