Rob Newton's second century of the match salvaged a draw for Northants after Derbyshire captain Wayne Madsen and wicketkeeper Tom Poynton fell 22 runs short of setting a new world-record ninth-wicket partnership.
Madsen and Poynton made 261 as Derbyshire were bowled out for 569, and Northants were in deep trouble as they slipped to 37-4 before Newton stepped up again with a career-best 119 not out off 167 balls to steady the ship.
Derbyshire's dynamic duo had their eyes on Arnold Warren and John Chapman's ninth-wicket record of 283 set back in 1910 against Warwickshire, but Poynton could add just a single before he was bowled off the eighth ball of the day.
It was the third highest ninth-wicket stand in the history of first-class cricket and Madsen eventually finished unbeaten on a colossal 231 off 400 balls.
Trailing by 169, Northants' second innings got off to an awful start when Kyle Coetzer (15) edged Groenewald to Poynton in the 10th over, and they soon had four down and looked in trouble.
Newton took control though and when he completed his ton off 130 deliveries he became the 11th Northants batsman to score a century in both innings of a match, and the first since Chris Rogers at Taunton in 2006.
Northants made it to 212-4 before the two captains shook hands on a draw.
A double century from captain Wayne Madsen helped Derbyshire to hit back in style against Northants and give their promotion hopes a huge boost.
It was a bad start to the day as they lost Ross Whiteley when needing 88 to avoid the follow on, but the Division two leaders ended the day on 512-8 with a lead of 112 going into the final day.
Madsen piled on 223 not out off 384 balls, including 31 fours, while he also formed part of an incredible partnership with wicketkeeper Tom Poynton.
Their unbroken ninth-wicket stand of 259 is currently the third-highest in the history of first-class cricket and it produced the first century of 22-year-old Poynton's career as he finished unbeaten on 105 from 209 deliveries.
Madsen completed the 13th century of his first-class career and his second at Northamptonshire in three years in the fourth over of the afternoon, before going on to complete the double hundred off 356 balls with a four through midwicket off Alex Wakely.
Poynton then completed his century off 194 deliveries towards the close on a day Derbyshire's promotion hopes received a massive boost.
Division Two leaders Derbyshire were reduced to 163-5 in reply to Northamptonshire's 400 on day two at Wantage Road.
Northants' last four wickets added 91 runs to their overnight 311-6, mainly through the flowing blades of James Middlebrook (71) and David Willey (60no).
Derbyshire seamer Tony Palladino added three more wickets on the day to finish with 5-82, his third five-wicket haul of the season.
Dan Redfern hit 70 either side of two rain delays and an early tea but Derbyshire's reply was stymied by the loss of regular wickets, including two late on for spinner Middlebrook (2-23).
Skipper Wayne Madsen (37no) will resume alongside Ross Whiteley (0no) on day three with his side still 237 runs in arrears.
Rob Newton struck his second century of the County Championship season to ensure Northamptonshire edged the first day of their Division Two clash with Derbyshire.
Newton made 115 from 174 balls, cracking 13 boundaries and a six, as the hosts finished the day on 311-6.
Having won the toss and elected to bat, Northants lost opener Kyle Coetzer (five) cheaply as he became one of Tony Palladino's two victims.
Niall O'Brien (41), David Sales (26) and Alex Wakley (37) all made solid contributions in the middle order, but it was Newton who went on to post a big score.
He eventually departed with just nine overs left in the day when he edged behind to wicket-keeper Tom Poynton off the bowling of Palladino.
James Middlesbrook brought up his half-century in the final over of the day and will resume Northants keeper David Murphy (16 not out) on Wednesday morning.