A bold last-day performance, imperative in the circumstances and topped with Deon Burton's winning goal, saved Portsmouth from relegation and will probably keep under-pressure manager Terry Fenwick in his job.
Fenwick has held the managerial reins for only 15 months following the sacking of Jim Smith, whose subsequent return to management has resulted - with bitter irony for Portsmouth - in promotion for Derby County.
Fenwick might have become another Fratton Park casualty if Portsmouth had fallen into the lower divisions for the first time in 13 years and just three seasons after a Smith-led team came within goal difference of gaining promotion to the Premiership.
This year goals have again kept Pompey in the First Division, their victory at the McAlpine Stadium sending down Millwall thanks to a superior goals- for total. The win was only their second in 12 matches, but it came at the crucial time and was well-deserved.
Jimmy Carter set up Burton for the decisive strike. He raced on to the winger's ninth-minute headed pass and drove the ball firmly into the net.
Huddersfield, with nothing to play for, lost striker Andy Booth and midfielder Lee Makel in a frantic five minutes of Pompey pressure and only goalkeeper Steve Francis, who made reflex stops from McLoughlin and Paul Hall then turned Andy Thomson's 35th minute, stopped Portsmouth taking total control.
The visitors never attacked with such intensity after the interval, though Burton sent a 65th-minute drive just over the bar and 10 minutes later Allen shot wide from 25 yards.
At the other end, visiting goalkeeper Alan Knight was never troubled. The game ended on a sour note as Huddersfield winger Ben Thornley, the subject of several dubious challenges in an increasingly niggly game, was sent off in injury time for a second bookable offence.
Goal: Burton (9) 0-1.
Huddersfield Town (4-4-2): Francis; Jenkins, Scully, Gray, Cowan; Edwards, Makel (Collins, 28), Bullock, Thornley; Booth (Baldry, 07), Jepson. Substitute not used: Sinnott.
Portsmouth (4-5-1): Knight; Thomson, Awford, Butters, Rees; Hall, McLoughlin, Allen, Carter, Simpson; Burton. Substitutes not used: Igoe, Flahavan, Bradbury.
Referee: J Rushton (Stoke-on-Trent).
Bookings: Huddersfield: Jenkins, Cowan. Portsmouth: Awford, McLoughlin, Allen, Simpson.
Sent off: Huddersfield: Thornley.
Man of the match: M Alley.
Attendance: 14,091.Reuse content