Cardiff boss Dave Jones was relieved after a last-minute winner from Jason Koumas spared City's blushes against 10-man Ipswich.
Koumas brought the ball across the danger area, slipped but recovered before smashing a shot into the roof of the net.
The Bluebirds had taken the lead on the half-hour mark when Joe Ledley crossed to Michael Ricketts and the Leeds loan striker rifled a shot in at the near post.
By then he had already missed a 13th-minute penalty after Fabian Wilnis had been red-carded for pulling back Cameron Jerome.
Jimmy Juan levelled the score with five minutes remaining when he whipped in a free-kick to give City keeper Neil Alexander no chance.
Just as it looked as though the Bluebirds were throwing away more home points Koumas popped up with that late winner.
City boss Jones said: "Sometimes you have to dig in but in the second half we had enough chances to kill the game off.
"When it is only 1-0 there is always the likelihood of a set piece paying off for them and that is what happened. It was difficult for us to shut up shop and Joe Royle's side played well but we should have been well ahead by the time they scored.
"Michael Ricketts tried to be too clever taking the spot kick and he won't be taking them any more.
"We went to Ipswich and played well without getting anything from the game and tonight we have made up for it."
Cardiff found it hard work against an eager Ipswich side who neatly passed the ball around and at times it looked as though it was the home side playing with a man short.
City keeper Alexander made several fine saves to keep his side ahead but justice appeared to be done when Juan levelled the scores.
"We were terrific in the first half and created three or four good chances," said Ipswich boss Joe Royle.
"I was unhappy with the sending off as there was very little contact and feel very hard done by even though we were stretched a little in the second half.
"It was a dodgy penalty decision and we saved that but playing most of the game with 10 men has cost us."
Not for the first time this season the Bluebirds were rescued by the talented Koumas but playing against 10 men they should never have found themselves in that position.