Match ends, Cardiff City 2, Huddersfield Town 1.
Substitute Junior Hoilett's late strike helped Cardiff City to a narrow win over managerless Huddersfield Town.
The contest was an audition for caretaker Terriers boss and former Cardiff captain Mark Hudson.
But Joe Ralls curled Cardiff ahead on 42 minutes and the hosts should have been clear at the break.
Trevoh Chalobah's fine second-half finish looked to have earned Huddersfield a point, before Hoilett's deflected shot won it.
Both Bluebirds boss Neil Warnock and his side came into this contest with a superb recent record against their opponents. Cardiff are now unbeaten in a dozen games against Huddersfield and the manager - who led the Terriers to promotion from the third tier in 1995 - has lost only two of his past 15 against them.
With Hudson keen to impress against his former side, he came up against a Cardiff team vastly improved from their weekend drubbing at Reading, but who almost paid the price for poor finishing.
The Bluebirds showed their attacking intent after only 90 seconds, when Josh Murphy curled at goal and keeper Kamil Grabara denied him at full stretch.
It was a first half where the hosts created enough chances to win several games and on 19 minutes it seemed harder for new striker Robert Glatzel to score than miss from six yards after Murphy's cross, but he blazed over before Leandro Bacuna also fired over from inside the box.
A goal was coming for the hosts and it arrived three minutes before the break, as hesitancy from Huddersfield's Jonathan Hogg following Aden Flint's knockdown allowed Ralls to collect and curl past Grabara.
Full-back Joe Bennett also blasted over in first-half injury time, as Cardiff missed a third gilt-edged opportunity.
They paid the price when Chalobah held off his marker early in the second half and beat former Huddersfield keeper Alex Smithies at his near post, fizzing the ball into the bottom corner.
The visitors improved vastly after the break and exerted far more control of the game, with Chalobah and Alex Pritchard seeing more of the ball.
Cardiff pushed for a winner, but it seemed destined to elude them when substitute Omar Bogle's fierce free-kick struck the crossbar.
With time and hope running out, Hoilett's shot struck Hogg and deflected past the helpless Grabara.
Even then the Terriers almost snatched a second equaliser in stoppage time, but Karlan Grant could only hit the side netting.
Cardiff City manager Neil Warnock told BBC Sport Wales: "I thought that was the best performance of the season and it was the most chances we have created.
"We made hard work of it, I don't know how we hadn't comfortably put that one to bed but their goal knocked the stuffing out of us.
"I thought we came back really strongly, the crowd roared us on and you've always got a chance when they are like that.
"I thought Lee Tomlin did well, I only asked him to give me 45 minutes. I thought everyone was good tonight... but my teams never make it easy."
Huddersfield Town caretaker manager Mark Hudson said: "I feel disappointed for the lads, for the fans that have travelled, I feel they showed a reaction of togetherness to go in 1-0 down and come out and do what we did for spells. It wasn't enough.
"Myself and the players are disappointed but we feel like there is something there. You could see it in spells, I asked them to train and play with intensity and we just fell short.
"But there is something there to spur us on and we've got another game on Saturday.
"I said pre-match that I want to manage this football club one day and that [ambition] continues."
- 3BennettBooked at 56mins
- 20WhyteSubstituted forVaulksat 90+4'minutes
- 17TomlinSubstituted forHoilettat 77'minutes
- 9GlatzelSubstituted forBogleat 76'minutes
- 4ElphickBooked at 80mins
- 8ChalobahSubstituted forBacunaat 77'minutes
- 18MbenzaSubstituted forDiakhabyat 74'minutes
- 17van La ParraSubstituted forCampbellat 84'minutes
- Jarred Gillett
- Shots on Target
Second Half ends, Cardiff City 2, Huddersfield Town 1.
Foul by Juninho Bacuna (Huddersfield Town).
Omar Bogle (Cardiff City) wins a free kick on the right wing.
Substitution, Cardiff City. Will Vaulks replaces Gavin Whyte.
Attempt missed. Karlan Grant (Huddersfield Town) left footed shot from the left side of the box is close, but misses to the left. Assisted by Terence Kongolo with a through ball.
Foul by Juninho Bacuna (Huddersfield Town).
Leandro Bacuna (Cardiff City) wins a free kick in the defensive half.
Offside, Cardiff City. Lee Peltier tries a through ball, but Gavin Whyte is caught offside.
Goal! Cardiff City 2, Huddersfield Town 1. David Junior Hoilett (Cardiff City) right footed shot from the left side of the box to the bottom left corner. Assisted by Josh Murphy.
Hand ball by Omar Bogle (Cardiff City).
Attempt missed. Omar Bogle (Cardiff City) left footed shot from the left side of the box misses to the left. Assisted by Joe Ralls.
Attempt missed. Leandro Bacuna (Cardiff City) right footed shot from outside the box is high and wide to the right. Assisted by David Junior Hoilett.
Attempt missed. Adama Diakhaby (Huddersfield Town) left footed shot from the right side of the box misses to the left. Assisted by Karlan Grant.
Substitution, Huddersfield Town. Fraizer Campbell replaces Rajiv van La Parra.
Offside, Cardiff City. Joe Ralls tries a through ball, but Sean Morrison is caught offside.
Foul by Jonathan Hogg (Huddersfield Town).
David Junior Hoilett (Cardiff City) wins a free kick on the right wing.
Terence Kongolo (Huddersfield Town) wins a free kick in the defensive half.
Foul by Joe Ralls (Cardiff City).