Jon Stead came off the bench to ensure Ipswich's unbeaten run in the Coca-Cola Championship continued with a fine winner at Cardiff.
Peter Whittingham had volleyed the home side into a first-half lead before Jon Walters and Stead drove home to make it seven games without defeat for Roy Keane's side.
Five of those previous six games had been draws however, and Town remain in the bottom three despite three precious points. Dave Jones' side fell out of the play-off zone after the late defeat in a game which saw both goalkeepers come off injured.
Stern John made his debut in attack for Ipswich after signing on loan from Crystal Palace this week while goalkeeper Richard Wright returned for his first start since the beginning of October after Asmir Begovic was recalled by parent club Portsmouth.
Keane's first game in charge was at Cardiff in April where he masterminded a 3-0 win but he had only won twice since then before kick-off and he saw Michael Chopra go close to an opener for the hosts in the third minute with a long-range effort.
Walters should have done better at the end of Ipswich's first attack when he headed over before Whittingham sprang into life. The former Aston Villa man connected wonderfully with a cross to hammer a volley against the crossbar before seeing another powerful hit turned over by Wright.
Wright was then forced off in the 25th minute through injury, leaving Arran Lee-Barrett to make his debut.
Chopra was the architect of Whittingham's 35th minute opener, cutting in from the right and standing up a ball for Whittingham to strike on the full beyond Lee-Barrett and into the far corner. But the home side were hampered at half-time with their goalkeeper David Marshall going off injured, Peter Enckelman coming on in his place.
Walters levelled matters with 13 minutes remaining. Owen Garvan played a ball behind the Cardiff defence and after showing his pace to get free, Walters coolly shot past Enckelman from the edge of the area.
Stead headed at Enckelman when well placed but saved his finishing for the winner in the 85th minute. Garvan again provided the assist, picking out Stead unmarked in the heart of the penalty area to place a low shot into the corner and give Keane a much-needed victory.
Copyright (c) PA Sport 2009, All Rights Reserved.