Derbyshire 261 (Andersson 79, Madsen 70, Balderson 4-71) and 139 for 3 need another 374 runs to beat Lancashire 367 (Green 121, Jennings 106) and 406 for 6 dec (Turner 121, Balderson 82, Jones 63)
Ashton Turner scored his second century in three innings to put Lancashire on course for what would be a first Rothesay County Championship victory of the season in the Division Two match against Derbyshire at Chesterfield.
The Australian made an unbeaten 121 from 135 balls and was well supported by George Balderson, 82 off 60, and 63 from Michael Jones before Lancashire declared on 406 for 6, with Ben Aitchison taking 3 for 64.
That set the hosts the small matter of 513 which would be their highest-ever fourth-innings total but by the close they were 139 for 3, still 374 runs away.
Lancashire began the day already well placed with a lead of 220 but Aitchison sent a tremor through the foundations with three wickets in an eight-over spell from the Lake End.
Josh Bohannon was drawn into pushing at one that did enough to take the edge before Keaton Jennings aimed a big drive and was given out caught behind although his reaction suggested he did not think he made contact.
When Matty Hurst was lbw to one that kept slightly low, Derbyshire sensed there might be an opening but first Turner and Jones and then Balderson emphatically reasserted Lancashire's authority.
Turner pulled Aitchison for six on his way to a 67-ball fifty while Jones was even more dominant, reaching his half-century, which contained two maximums, from only 41 balls. But it was the running between the wickets as much as the boundary count that hurt Derbyshire with the pair finding the gaps at will to cruise along at more than six an over.
Jones swept Mitch Wagstaff for another six and was eying a fourth until Aitchison at deep midwicket knocked the ball up for Zak Chappell to complete a smart relay catch.
But by lunch, Lancashire's lead was 377 and that soared as Balderson engaged the turbo, racing to a 42-ball fifty before Turner drove Wagstaff for his 10th four to reach a fine hundred from 124 deliveries.
The lead was over 500 when Balderson drove Martin Andersson to cover, ending a stand of 157 in 21 overs, which was the signal for Lancashire to declare leaving Derbyshire a highly improbable target.
A more realistic proposition was to hold out for a draw but they lost Caleb Jewell in the fifth over when he was squared up by James Anderson and caught at third slip. It was the fourth time this season that Anderson has dismissed Jewell who, as an Australian, is in good company.
That was Lancashire's last success for 24 overs as Wagstaff and Harry Came stood firm with the latter twice stroking Anderson for two boundaries after tea.
But the odd ball was keeping low and Balderson broke the stand when he squeezed one through Wagstaff's defence and Came went in the next over, caught behind pushing at Tom Bailey.
Derbyshire's position would have been even more parlous if Wayne Madsen on eight and Brooke Guest on 14 had not been dropped in the slips but Lancashire remain strong favourites to complete the job on the final day.