Lee Tomlin scored the only goal of the game as Cardiff gave their play-off hopes a major boost by winning 1-0 at bottom side Luton.
Tomlin decided the contest with 17 minutes to go, winning it for the visitors when his effort from just outside the box nestled into the bottom corner.
Victory was enough for the Bluebirds to climb up to eighth in the table, just four points behind the top six.
The visitors had chances early on from a number of crosses, with home defender Matty Pearson forced into a goal-line clearance, before the Hatters settled down.
They created two decent opportunities for Harry Cornick, the first from Ryan Tunniclffe's pass going under his foot and then the attacker dragging wide after being found by Izzy Brown.
Pelly-Ruddock Mpanzu slammed a half volley off target on his left foot midway through the half, with top scorer James Collins also wide after receiving Brown's near post corner.
Glen Rea's header from a set-piece was easy for Alex Smithies too, the City goalkeeper having a very comfortable afternoon.
In the second period, Cardiff full-back Joe Bennett sent an ambitious long distance attempt into the hoardings, before his dipping corner was tipped away by home keeper Simon Sluga when it appeared destined for the top corner.
Sluga made a superb save on 70 minutes to prevent the Bluebirds taking the lead as with Pearson getting his back header all wrong, he stuck out an instinctive glove to prevent Callum Paterson's dink finding the net.
However, he was beaten moments later, on 73 minutes, Tomlin finding some space on the edge of the box and lashing a drive into the bottom corner for his seventh goal of the campaign.
Collins almost had an immediate equaliser, throwing himself full length at full back Dan Potts' cross, only to head wide of the target from close range.
Tomlin tried for a second – his headed attempt not bothering Sluga – but the Hatters could not find a leveller, with Collins once more missing the target from substitute Kazenga LuaLua's low cross.
Town's top scorer should have levelled in stoppage time as City keeper Smithies fumbled George Moncur's long-range shot, only for Collins to miss his kick from a matter of yards out.