A flat performance was punished by Cardiff City as Huddersfield Town were condemned to a third successive defeat.
The Welsh side scored twice in the second half after Nahki Wells' 40th-minute equaliser cancelled out Peter Whittingham's opener.
Lex Immers, the Dutch forward on loan from Feyenoord, restored Cardiff's lead before Whittingham counted again with a well-struck free-kick
Harry Bunn drilled in an injury-time shot to give Town hope, but this was a disappointing display, leading to who a first home defeat in six in all competitions.
Huddersfield Town: Steer, Davidson, Hogg, Paterson, Matmour, Cranie, Huws (Whitehead 59), Bunn, Wells, Dempsey (Bojaj 85), Lynch.
Cardiff: Marshall, Fabio, Malone, Connolly, Manga, Ameobi, O’Keefe (Dikgacoi 89), Ralls, Whittingham, Immers (Gunnarsson 77), Pilkington (Macheda 69).
A Town corner at which the home side were penalised and a Nahki Wells shot which went wide were the only eventful moments in the early stages.
Cardiff twice got into promising attacking positions, with Town old boy Anthony Pilkington clear in on goal in one of them, but were flagged offside.
Karim Matmour was catching the eye on his full debut, but Town were unable to take advantage of his lively work on the right flank.
Kyle Dempsey, playing at right-back, won a corner with a booming cross, but when he received the ball from the flag kick and advanced menacingly, shot well over.
Cardiff finally made the breakthrough in the 37th minute, when Peter Whittingham shot home from Pilkington's cut-back.
But Nahki Wells levelled just three minutes later, controlling the ball neatly and drilling home left footed.
Harry Bunn should have done better than fire wide when he met a Dempsey cross early in the second half.
Town made their first change in the hour, when Dean Whitehead replaced Emyr Huws, who had taken a knock.
Within a minute, Cardiff were ahead again through Dutchman Lex Immers, who finished off a neat passing move in which Sammy Ameobi was prominent.
The visitors survived a penalty appeal against defender Matthew Connolly, who appeared to handle as the ball bounced up from a Town corner.
Then keeper David Marshall came to Cardiff's rescue then he parried a well-struck Wells effort.
His opposite number Jed Steer did well to divert a Joe Ralls piledriver to safety via the bar, but could do nothing when Peter Whittingham fired his second of the match with a sweetly-struck free-kick in the 79th minute.
Bunn fired into the roof of the net from Wells' lay-off in stoppage time, but Cardiff held out for the points.
Karim Matmour showed glimpses of promise on his full debut for Town.
Boss David Wagner needs to stop the rot after three defeats in a row.