A Luke Beckett double helped Huddersfield beat Carlisle as Town picked up their first victory in five games.
But the Terriers made hard work of securing the maximum haul as Carlisle twice came close to snatching a late equaliser.
Peter Murphy hit the woodwork in the 90th minute before Town keeper Matt Glennon clawed Paul Thirlwell's close-range effort round the post.
Town dominated the early stages and Martin McIntosh's header was tipped over by Keiren Westwood before the hosts took the lead in the 21st minute.
Simon Hackney lost possession to Beckett, who raced through the middle into the Carlisle 18-yard box where he slipped the ball into the bottom corner despite Chris Billy and Kevin Gray's efforts to stop him.
Just 11 minutes later Beckett scored his second when Peter Murphy allegedly handled his intended cross and, from the resulting penalty, the Town striker beat Westwood again.
Town's second sparked Carlisle to life and Hackney made amends for his earlier mistake by halving the deficit.
He collected an inch-perfect pass from Chris Lumsden on the right and from 25 yards beat Glennon's despairing dive with a powerful shot into the left-hand corner of the net.
The home side were forced to reorginise after the break when Tom Clarke went off though injury to be replaced by Chris Brandon.
Huddersfield sat back and allowed Carlisle to pour forward and in the 58th minute an ambitious lob from Kevin Gall was tipped over by Glennon.
Six minutes later Glennon was forced to palm away a Lumsdon corner and moments later Paul Arnison shot over after making a good run into the box.
But the visitors' best chances came right at the death and Huddersfield were lucky to claim the three points.
Murphy struck Glennon's woodwork with a fiercely driven free-kick from 18 yards after Michael Collins had up-ended Thirlwell.
And in stoppage time midfielder Thirlwell from inside the six-yard area forced Glennon to make a reflex save when the former Sunderland man's shot was tipped round the post by the Town keeper.