A second-half comeback saw Ipswich gain their first away win of the season.
Cardiff, on a two-game losing run, went ahead when Jay Bothroyd and Mike Chopra set up Peter Whittingham for a sweet, dipping 17-yard shot to the top corner.
Ipswich got on top after the break as Owen Garvan's delightful touch set up Jon Walters on the counter-attack, a superb volley providing the equaliser.
With just five minutes to go Garvan found Jonathan Stead in the box, the substitute's low shot winning the game.
Ipswich are now unbeaten in seven games, although five of those have been draws and they remain in the bottom three.
Peter Whittingham's goal was his 13th of the season
The victory, just the second of the season in the Championship for the Tractor Boys, will ease the pressure on manager Roy Keane.
Cardiff lost the chance to climb into the play-off zone above local rivals Swansea.
Both sides will be troubled by injuries to their goalkeepers, Richard Wright going off after 25 minutes and David Marshall leaving the game with a groin injury just after half-time.
Cardiff manager Dave Jones: "The players never made the right decisions after the break and it was a game we should never have lost.
"When the crowd went against the players they started to panic and some of them never wanted the ball.
Jones rues 'worst' Cardiff loss
"The midfield and front line were non-existent and we hardly strung two passes together.
"When you are fighting hard to get something out of a game you have to win the ball in tackles and we didn't even do that.
"I have seen two stoppable goals go in and we need to hold onto the ball more and make the right decisions.
"Players will make mistakes but it is how you respond to them that count and everyone in the dressing room is responsible as that was our worst performance at this ground.
"At the moment we are easy to break down but we are not a bad team collectively.
"We have to do better and if the players pull their fingers out we can soon get back on track."
Ipswich manager Roy Keane:
"I've had my share of luck here at Cardiff in the past but with the chances we had I think we deserved to win.
"It was an open game but at half-time I told my players it would be a test of character and they have come through it well.
"The subs played a big part in the victory and although I have been disappointed with results to date I have never lost faith in the squad.
"Jon Walters has been a good leader over this difficult period and he scored a superb equaliser while Jon Stead is starting to make a habit of scoring vital goals for us."
90:00+1:46 Handball by Jonathan Stead. Free kick crossed left-footed by Peter Whittingham, free kick awarded for a foul by Jay Bothroyd on Owen Garvan. Direct free kick taken by Arran Lee-Barrett.
88:03 Peter Whittingham takes a shot. Blocked by Damien Delaney.
86:01 Substitution Ross McCormack is brought on as a substitute for Gavin Rae.
84:46 Assist on the goal came from Owen Garvan.
84:46 GOAL - Jonathan Stead:Cardiff 1 - 2 Ipswich Jonathan Stead gets on the score sheet with a goal from inside the box to the bottom right corner of the goal. Cardiff 1-2 Ipswich.
83:36 Foul by Jonathan Walters on Mark Hudson, free kick awarded. Peter Enckelman takes the direct free kick.
83:09 Corner taken left-footed by Owen Garvan, Mark Hudson manages to make a clearance.
82:30 Unfair challenge on Gareth McAuley by Joe Ledley results in a free kick. Arran Lee-Barrett takes the free kick.
81:18 Peter Whittingham crosses the ball in from the free kick, Damien Delaney makes a clearance.
81:18 Booking Owen Garvan goes into the book for unsporting behaviour.
81:01 Damien Delaney concedes a free kick for a foul on Jay Bothroyd.
79:32 Owen Garvan crosses the ball, Jonathan Stead takes a shot. Save by Peter Enckelman.
78:44 The official flags Stern John offside. Free kick taken by Peter Enckelman.
77:42 Jay Bothroyd is ruled offside. Arran Lee-Barrett takes the indirect free kick.
76:45 Peter Whittingham crosses the ball from the free kick left-footed from right channel.
76:45 Booking Damien Delaney goes into the book.
76:33 Damien Delaney concedes a free kick for a foul on Michael Chopra.
75:21 Substitution Kelvin Etuhu on for Chris Burke.
72:39 Assist by Owen Garvan.
72:39 GOAL - Jonathan Walters:Cardiff 1 - 1 Ipswich Jonathan Walters gets on the score sheet with a goal from just inside the area to the bottom right corner of the goal. Cardiff 1-1 Ipswich.
71:23 The assistant referee flags for offside against Stern John. Peter Enckelman restarts play with the free kick.
70:34 Joe Ledley challenges Owen Garvan unfairly and gives away a free kick. Direct free kick taken by Liam Rosenior.
70:00 David Wright takes a shot. Peter Enckelman makes a save.
66:22 Corner taken right-footed by Grant Leadbitter from the left by-line, Jonathan Walters takes a shot. Peter Enckelman makes a save.
64:46 Substitution Carlos Edwards goes off and Alan Quinn comes on.
62:56 Jonathan Walters produces a right-footed shot from just outside the area that goes wide left of the goal.
61:46 Corner taken right-footed by Chris Burke to the near post, Damien Delaney manages to make a clearance.
59:06 Jonathan Stead takes a shot. Save by Peter Enckelman.
52:31 Joe Ledley takes a shot. David Wright gets a block in.
51:50 Unfair challenge on Adam Matthews by Jonathan Stead results in a free kick. The free kick is swung in left-footed by Peter Whittingham, Damien Delaney makes a clearance.
51:06 Substitution Jonathan Stead replaces Tamas Priskin.
46:38 The assistant referee flags for offside against Tamas Priskin. Peter Enckelman takes the free kick.
45:52 Peter Whittingham takes a shot. Arran Lee-Barrett makes a save.
45:01 The match restarts for the second half.
45:01 Substitution (Cardiff) makes a substitution, with Peter Enckelman coming on for David Marshall.
Half Time
45:00+3:59 The match has reached half-time.
45:00+2:40 Jonathan Walters is penalised for handball and concedes a free kick. Mark Hudson restarts play with the free kick.
45:00+0:51 Handball by Stern John. Indirect free kick taken by Mark Hudson.
44:36 Corner taken by Owen Garvan, Gabor Gyepes manages to make a clearance.
40:55 Joe Ledley has an effort at goal from just outside the box which goes wide of the right-hand upright.
39:55 The assistant referee flags for offside against Stern John. David Marshall takes the free kick.
39:26 The assistant referee signals for offside against Michael Chopra. Liam Rosenior takes the indirect free kick.
36:34 Stern John takes a shot. Save by David Marshall. Inswinging corner taken by Grant Leadbitter from the left by-line played to the near post, clearance by Mark Hudson.
34:44 Assist by Michael Chopra.
34:44 GOAL - Peter Whittingham:Cardiff 1 - 0 Ipswich Peter Whittingham scores a goal from deep inside the penalty box to the top left corner of the goal. Cardiff 1-0 Ipswich.
33:08 Damien Delaney gives away a free kick for an unfair challenge on Jay Bothroyd. Free kick crossed left-footed by Peter Whittingham from right channel, clearance made by Carlos Edwards.
31:38 Corner taken by Chris Burke from the left by-line, Unfair challenge on Arran Lee-Barrett by Michael Chopra results in a free kick. Arran Lee-Barrett restarts play with the free kick.
29:08 Handball decision goes against Gavin Rae. Free kick taken by Liam Rosenior.
27:43 Gavin Rae concedes a free kick for a foul on Owen Garvan. The ball is sent over by Grant Leadbitter, Close range headed effort by Stern John misses to the right of the goal.
26:40 Unfair challenge on Peter Whittingham by Carlos Edwards results in a free kick. Free kick taken by Mark Kennedy.
24:45 Substitution (Ipswich) makes a substitution, with Arran Lee-Barrett coming on for Richard Wright.
21:18 Stern John gives away a free kick for an unfair challenge on Mark Kennedy. Direct free kick taken by Mark Kennedy.
17:34 Stern John fouled by Gabor Gyepes, the ref awards a free kick. Shot comes in from Grant Leadbitter from the free kick.
14:32 Inswinging corner taken by Peter Whittingham from the right by-line played to the near post, Owen Garvan manages to make a clearance. Chris Burke takes the inswinging corner, Gareth McAuley manages to make a clearance.
13:07 Peter Whittingham takes a corner.
12:44 Peter Whittingham takes a shot. Save made by Richard Wright.
11:41 David Marshall restarts play with the free kick.
11:41 Booking Stern John shown a yellow card.
11:15 Free kick awarded for an unfair challenge on Gabor Gyepes by Stern John.
7:54 Shot from 12 yards from Peter Whittingham.
7:29 Tamas Priskin takes a shot. Gabor Gyepes gets a block in.
6:51 Inswinging corner taken from the left by-line by Owen Garvan, clearance by Gabor Gyepes.
5:09 Liam Rosenior challenges Jay Bothroyd unfairly and gives away a free kick. The free kick is delivered right-footed by Chris Burke from left channel.
3:59 Jonathan Walters produces a header from inside the six-yard box that clears the bar.
2:51 Michael Chopra has a shot on goal from outside the area which misses right.
0:00 The referee gets the game started.
Live text and data provided by The Press Association.
Bookmark with:
What are these?