Last updated on .From the section Championship

Cardiff City's Robert Glatzel heads towards goal under the challenge of Huddersfield Town goalkeeper Kamil Grabara

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."