Town catch up with Wigan
Ipswich moved level on points with second-placed Wigan as they hit back from a goal down to see off promotion rivals Derby at Portman Road.
Marcus Tudgay headed the Rams into an early lead only for Town skipper Jim Magilton, who has been left out of the side in recent weeks, to equalise with his first goal of the season.
England Under-21 international Darren Bent gave Town the lead moments after the restart with a cool finish following a fine through-ball from Tommy Miller, who added a third 20 minutes from time.
Inigo Idiakez set up a tense final six minutes with a free header but George Burley's men could not force an equaliser.
Derby, whose superb away record of six wins and one draw in their last seven games had put them into the play-off frame, got off to a dream start by taking a seventh-minute lead.
A mix-up between Richard Naylor and Jason de Vos near the halfway line allowed the Rams to break quickly, with Morten Bisgaard sending over a perfect diagonal cross for the unmarked Tudgay to head home his 10th goal of the season.
Town threatened briefly as Bent sent in a great cross to the near post for Shefki Kuqi but he fluffed his lines under pressure from Pablo Mills.
The Tractor Boys should have equalised midway through the half when Darren Currie's corner was headed powerfully against the crossbar by Naylor.
But County broke away almost instantly and should have extended their lead as Tommy Smith found acres of space to send over a cross for lone striker Grzegorz Rasiak only for the Pole to head over from a few yards out.
The game was flowing from end-to-end at breakneck speed and it was the home side who levelled in the 24th minute.
Kuqi mesmerised a couple of Derby defenders before sending in a cross for strike partner Bent, who laid the ball off for Magilton to fire home from 15 yards for his first goal in 18 months.
Ipswich nearly took the lead a minute later when Naylor's diving header from a Currie corner was cleared off the line by Adam Bolder.
As half-time approached Currie sent in a dangerous cross for Bent again to knock the ball back for Magilton, but this time he completely missed the ball and the danger was cleared.
But Town made a sensational start to the second half, taking the lead just 17 seconds from the whistle.
Midfielder Miller picked out the run of Bent, who outpaced two defenders before slipping the ball beyond keeper Lee Camp.
Bisgaard got behind the Town defence eight minutes but blazed over when in a great position.
Ipswich were denied by the woodwork once again as Kuqi beat the offside trap from Bent's through-ball but his shot clipped the crossbar.
However, the match looked to be over as a contest in the 71st minute when Miller scored his sixth goal in eight games.
Kuqi's header from a deep Currie corner was cleared off the line, but the ball fell invitingly to Miller lurking 20 yards out and he fired through a crowded box.
Just as Ipswich thought the points were safe Smith sent over a cross for Idiakez, who made no mistake with a free header.