Famara Diedhiou continued his hot streak with a first half double as Bristol City edged out Huddersfield in a frantic Sky Bet Championship clash at Ashton Gate.
The big striker netted on 22 minutes, running through unchallenged, after Antoine Semenyo had dummied an Alfie Mawson pass, and wrong-footing goalkeeper Ryan Schofield before shooting into an unguarded net.
Diedhiou doubled the advantage four minutes later, latching onto Kasey Palmer's ball into the box and firing low past the exposed Schofield.
Juninho Bacuna reduced the deficit with a close range shot from Isaac Mbenza's clever backheel just before the hour. And it took a brilliant late save from Dan Bentley to preserve three points for the hosts when he kept out Bacuna's late volley from 25 yards.
Huddersfield were unlucky on the balance of play but Diedhiou now has six goals in his last seven appearances and is keeping City's play-off bid on course.
Both sides had chances in an open start to the game. Nahki Wells should have done better for City than glance a header wide from Adrian Mariappa's second minute cross, before Lewis O'Brien's penetrating run ended with a shot that was tipped onto a post by Bentley in the seventh minute.
While Diedhiou's double salvo looked to have put City in command, the visitors still threatened going forward and O'Brien had another effort blocked.
City boss Dean Holden had to make a change on 40 minutes when Tommy Rowe hobbled off to be replaced by Jack Hunt, Mariappa switching from right to left-back to accommodate the substitute.
Hunt's first meaningful action was to head an Alex Vallejo effort off the line and Harry Toffolo shot wide of the near post as City survived some heavy pressure to protect their lead until the break.
The second half began like the first, Semenyo breaking clear for City only for his control to let him down, before Bentley raced from his line to deny Fraizer Campbell.
The dangerous O'Brien saw his low drive blocked in a crowded box and a Campbell shot was deflected for a corner as Huddersfield threw everything into attack.
Bacuna's goal was well deserved and Campbell should have made it 2-2 soon afterwards, volleying badly wide from Toffolo's pinpoint cross.
Holden responded by taking off strikers Diedhiou and Wells and sending on Chris Martin and midfielder Adam Nagy, switching to a 4-5-1 formation.
It reflected Huddersfield's dominance as Vallejo thundered a shot against the crossbar from 30 yards – the midfielder's last contribution as he made way for Alex Pritchard.
After Bentley's acrobatic tip over from Bacuna, Pipa's added-time shot was deflected onto a post – but the hosts held on.