Leicestershire 213 (Evans 63, Conners 4-62) and 146 for 6 (Kimber 33*, Thomson 3-36) trail Derbyshire 531 (Masood 219, Madsen 94, McKiernan 101, du Plooy 61*, Barnes 5-101) by 172 runs
Derbyshire are within reach of a first victory of the LV= Insurance County Championship season after Leicestershire finished day three at the Uptonsteel County Ground six wickets down in their second innings and still 172 behind.
Leicestershire seamer Ed Barnes took five wickets in an innings for the first time earlier in the day as Derbyshire lost their last six first-innings wickets for 27.
But after a maiden century from Mattie McKiernan enhanced the value of Shan Masood's superb double-hundred on Friday, Derbyshire still totalled 531 for a lead of 318.
It left Leicestershire, who had to fight rearguard actions to emerge with a draw from both of their opening Division Two matches, faced with surviving two sessions just to take the contest into the final day. They succeeded in that but it will need an extraordinary effort from their tail to avoid defeat this time.
The morning belonged to McKiernan and latterly to Barnes, the Leicestershire seam bowler, whose dismissal of McKiernan launched an extraordinary spell within a spell that brought him all of his five wickets in the space of 26 deliveries at a cost of just eight runs.
McKiernan, a 27-year-old legspinner who spent more than 12 years at Lancashire without making a senior appearance, has played more white-ball cricket than red since joining Derbyshire in 2018 but that should soon be corrected on this evidence.
After playing an important role as one of double-centurion Masood's partners on Friday, sharing a stand of 129 for the fourth wicket, McKiernan cut Callum Parkinson's left-arm spin for three fours before moving into the 90s by pulling Barnes for six. His century came off 189 balls and contained 11 fours as well as that six.
Against a Leicestershire attack in which Will Davis could not participate because of injury, McKiernan and Leus Du Plooy took Derbyshire's first-innings total beyond 500 for the second successive match - and in consecutive innings for only the second time in the county's history - but when Barnes thudded one into McKiernan's front pad to have him leg before, the narrative of the morning changed dramatically.
Barnes, who was nought for 93 before umpire Neil Bainton granted him this success, dismissed Anuj Dal lbw and had Alex Thomson caught behind from consecutive balls, before Nick Potts chopped on and Sam Conners was bowled. His final analysis read 5 for 101 but his 10-over spell on the day was worth 5 for 28.
After Parkinson wrapped up the innings on the stroke of lunch when Suranga Lakmal chipped him straight to short midwicket, Derbyshire made important inroads before tea as opener Hassan Azad and Leicestershire skipper Colin Ackermann both fell, along with George Rhodes.
Thomson accounted for Azad, the off-spinner's turning delivery finding a thin outside edge that turned into a looping catch to Wayne Madsen at slip, seemingly via the left glove of wicketkeeper Brooke Guest. He then bowled Rhodes before the introduction of Dal's medium pace induced a miscued drive from Ackermann that went straight to short cover.
A stubborn 33 from Sam Evans ended when he was leg before to Sam Conners and Wiaan Mulder's rather more entertaining 25 was terminated by the same method by the 19-year-old Potts, then Thomson held a stunning low return catch to remove Harry Swindells, with Louis Kimber 33 not out at the close.