Derbyshire in the ascendancy
Wayne Madsen and Greg Smith were the scourge of Leicestershire to give dominant Derbyshire a great chance of celebrating their first LV= County Championship win of the season.
Madsen scored a century against Leicestershire at Derby last year and he completed another here after the hosts began the second day on 101 for four.
The South African opener made 106 and Smith 99 before captain Luke Sutton declared on 439 for nine - a lead of 209 - leaving the visitors a tricky three overs, which they survived to close on four without loss.
The odds are heavily stacked against Leicestershire saving the match, with Will Jefferson unable to open after he had to leave the field in the morning with a thigh strain.
The contest had been in the balance when play began but an opening maiden proved a false dawn as Leicestershire delivered a shocking performance in the field.
The day might have followed a different course if the visitors had taken a chance to break the fifth-wicket stand in the first hour.
Madsen was on 54 and Derbyshire were 160 for four, still 70 behind, when he was beaten by Claude Henderson, but Tom New missed the stumping and the ball went away to add to the eventual total of 20 byes, half of the total extras.
Leicestershire became increasingly ragged, prompting skipper Matthew Hoggard to take the unusual step of calling his team together between overs to try and lift them.
It did not achieve the breakthrough as Madsen, who reached his century off 189 balls just before lunch, and Smith batted through the first session, adding 152 runs in 32 overs.
The pair stayed together for another 11 overs to take their stand to 189, beating the previous Derbyshire fifth-wicket record against Leicestershire of 170 set in 1895, before Hoggard's men finally celebrated a wicket.
Madsen had made 106 when he swept Henderson to James Taylor at square-leg, but Smith missed out on a second century of the season when he was lbw playing across the line at Nadeem Malik.
Derbyshire's lead was only 60 at that stage but Leicestershire could make only one more breakthrough before tea, Jon Clare caught behind off a rising delivery from Hoggard.
Sutton drove back a return catch to Henderson as he tried to accelerate but Tim Groenewald followed his first-day five-wicket haul with a half-century that included six fours and two sixes before Sutton called a halt to the innings.
With Jefferson unable to take his place at the top of the order, Paul Nixon opened with Greg Smith to negotiate an awkward 10 minutes, but Leicestershire have it all to do on the last two days, with little prospect of any help from the weather.