A late header from experienced striker Andy Booth proved decisive in a full-bloodied West Yorkshire derby as Huddersfield maintained their promotion challenge.
The Terriers gained some revenge for losing twice to their arch-rivals last season, but the travelling fans were relieved to see Booth snatch the points with a real poacher's finish 11 minutes from time.
The game had opened at a frantic pace and City skipper David Wetherall had to deal with two early attacks as the Terriers ripped into their neighbours from the off.
But it was the Bantams who carved out the first opening through the lively Bobby Petta whose weaving run opened up the visitors after just five minutes before striker Andy Cooke slipped the ball wide to winger Ben Muirhead.
Muirhead however blazed high and wide from the edge of the box and Town's neat approach play was rewarded after 21 minutes when midfielder Mark Hudson struck with a 20-yard free-kick.
City felt hard done by when referee Tony Leake ruled that Wetherall had tugged Gary Taylor-Fletcher's shirt, but worse was to come as Hudson's in-swinging right-foot curler drifted beyond keeper Russell Howarth into the far corner.
Town should have doubled their advantage a minute later when another free-kick again caused hesitation in the City defence and centre-half David Mirfin headed wide at the back post.
Former Celtic man Petta continued to impress with his tidy play and he fired City level in spectacular fashion with a well-struck free-kick after 35 minutes.
Again the defenders raged at Mr Leake after he penalised Mirfin for a push on Cooke and Petta made sure Town paid a heavy price with a curling left-foot strike which beat keeper Paul Rachubka comfortably.
Eleven minutes after the break City were sliced open by a sensational run from Taylor-Fletcher but when he laid the chance on a plate for Tony Carss he scooped his eight-yard effort over the bar.
Town manager Peter Jackson introduced leading scorer Pawel Abbott from the bench just after the hour and he wasted a great chance soon after when he caught the City back-line flat-footed but could only blaze his shot over.
As both sides battled for the decisive winner Booth showed his goal-scorer's instinct when he reacted first to Nathan Clarke's overhead kick and glanced a header beyond the diving Howarth.