Philip Billing's super strike came too late to save Huddersfield Town from defeat at Cardiff City.
The substitute's 70th-minute sizzler made for a tense finale in South Wales but former Town manager Neil Warnock's side held out as David Wagner's men suffered a third successive setback on away soil after losing at Preston North End and Fulham.
Head coach Wagner had flagged up the danger posed by Cardiff from set-pieces, but his side still struggled to deal with them, and have conceded 11 goals over those three away games.
Former loanee Sean Morrison headed home the opener from a corner before Junior Hoilett finished from close-range after keeper Danny Ward parried Anthony Pilkington's shot.
Tommy Smith pulled one back with a neat finish from Kasey Palmer's pass, but Cardiff's two-goal cushion was restored before the break when Rickie Lambert pounced after a long-range free-kick was flicked on.
Town only came to life after Billing's thunderbolt from the blue.
First Half
5 mins: Anthony Pilkington fires over for Cardiff.
6 mins:Nahki Wells' shot is saved.
10 mins: Home skipper Sean Morrison heads wide.
13 mins: Danny Ward saves from Morrison.
15 mins:Morrison heads home from a Peter Whittingham corner 1-0.
17 mins:It's 2-0 as Junior Hoilett nets from close range after Ward parries Pilkington's shot.
28 mins:Tommy Smith pulls a goal back with a neat finish from Kasey Palmer's pass. 2-1.
31 mins:Rickie Lambert restores Cardiff's two-goal cushion, shooting in off Ward's left-hand post after Morrison flicks on a long free-kick. 3-1.
39 mins: Palmer's shot is blocked.
Second Half
56 mins: Joe Bennett's shot is blocked.
59 mins: Ward collects Gunnarsson's awkward long throw.
63 mins: Wells' shot is straight at Cardiff keeper Ben Amos.
70 mins:Philip Billing lashes home a shot from the edge of the area and it's 3-2.
89 mins: Chris Lowe's inswinging corner is headed clear.
Line Ups
Cardiff City: Amos, Peltier, Morrison, Bamba, Bennett, Whittingham, Ralls, Gunnarsson, Hoilett (Richardson, 89), Pilkington, Lambert (Gounongbe, 75).
Subs not used: Noone, Connolly, Harris, Chamakh, Wilson.
Town: Ward, Smith, Hefele, Schindler (Scannell, 62), Stankovic, Lowe, Hogg (Billing, 62), Mooy, Kachunga, Palmer, Wells.
Subs not used: Whitehead, Hudson, Holmes-Dennis, Van La Parra, Coleman.
Referee: Tim Robinson (West Sussex).