Ipswich manager Paul Jewell hailed his side's character as they recorded their fourth successive home win by beating Peterborough in a pulsating contest.
The hosts, who had added motivation after Darren Ferguson's side inflicted a 7-1 hammering in the reverse fixture, led when midfielder Grant Leadbitter drilled in his third goal in his last two games but Posh's recent signing Tyrone Barnett brought them level before half-time.
There were then three goals in the final 13 minutes as Daryl Murphy's close-range header put Ipswich back in front before Emile Sinclair squeezed in a leveller.
However, just two minutes later full-back Aaron Cresswell's long-range shot took a deflection to settle the game in the hosts' favour.
"In the first half I thought they shaded it, but in the second we were the better team and showed great character to score again after their second equaliser," said Jewell.
"We had a bit of luck with the third goal but we would definitely have lost not so long ago. We know we need to tighten up defensively.
"We've known that all season but what we have got in us at the moment is goals. We're creating lots of chances and today we scored a couple from set-plays, which is vitally important.
"We had 20 shots and they had 14 or 15. It was a great, entertaining game.
"Both sides tried to win and both know what their strength is - going forward and trying to score more than the opposition.
"We attacked and then they attacked."
Posh boss Darren Ferguson felt his side were very unfortunate to finish empty-handed.
"We were certainly unlucky not to get a point," he said.
"When you equalise with six minutes left you don't expect to lose. It wasn't a game we deserved to lose and it was an unfortunate deflection that got them their winner.
"But we should have had two or three clear before their first goal and couldn't score when we were in control.
"It's happened so many times, when we've been in control but have not been ruthless enough to kill games off.
"In that first opening period we had opportunities to do that. I've just said to the players that we've lost too many games.
"I can think of five or six where we should have picked up points and had we won today we'd almost be home and hosed (in terms of avoiding relegation).
"But it's in our hands and our last two performances have been encouraging. We've created a lot of chances and given our opposition a lot of problems."
Ferguson added: "It was a good game and a great advert for the league. You see a lot of matches at this stage of the season that can be a bit mundane.
"One thing that I'm pleased about at the moment is the fact we're getting performances.
"We're creating chances and I don't think the sides below us can say that. Our goal difference is worth a point."