Leicestershire 329 and 307 for 7 (Cosgrove 126*, Ali 62) lead Derbyshire 352 (Freckingham 4-91) by 284 runs
Mark Cosgrove scored his second century of the season against Derbyshire to raise Leicestershire's chances of completing a championship double over their local rivals in the Division Two match at Derby.
The Foxes skipper followed his hundred at Grace Road last month with an unbeaten 126, his highest score of the season, after the visitors had been in trouble at 55 for 3 and shared a fourth wicket stand of 144 with Aadil Ali who made 62
Mark Footitt, who could be playing his last game for Derbyshire, was again the pick of the home attack, taking three more wickets to claim 10 in a match for the first time in his career but at the close Leicestershire were 284 in front on 307 for 7.
The first part of the day had belonged to Derbyshire with Ben Cotton scoring a career-best 43, adding 65 in 14 overs with Tom Millns to give their side a slender 23 run lead before Footitt plunged the visitors into trouble with two wickets in three overs.
Cotton defeated Ned Eckersley's defence push to leave the batsmen with the worrying statistic of having been bowled in 14 of his 33 first-class innings this season and when Footitt had Dan Redfern caught at second slip and Angus Robson edged behind, Leicestershire were only 32 runs ahead.
Another wicket at that stage would have left them in danger of losing in three days but Cosgrove has a good record at Derby, having scored a career best 233 for Glamorgan on this ground in 2006, and after a cautious start, he began to put his team back in the contest.
Ali again showed impressive judgement and temperament to help his captain restore the balance, pulling Wes Durston over the long on boundary after Cosgrove had driven the off-spinner for six.
Cosgrove drove Millns for four to take the stand past 100 and the intensity of the cricket led to the umpires speaking to both captains after an exchange between Cosgrove and Cotton just before tea.
Perhaps that disturbed Ali's concentration because he was lbw to the final ball of the session from Durston and when Niall O'Brien fell to Footitt without scoring, Derbyshire sensed another opening.
But Cosgrove, who completed 1,000 championship runs for the season, was the key and he reached his fourth hundred and his third in eight innings when he drove a Durston full toss for his 18th four.
Lewis Hill helped him add 61 in 15 overs and with Ben Raine chipping in with 27, Derbyshire have a lot to do to avoid going through a season without a home championship win for the first time since 2005.
"After the morning session when we didn't play our best cricket, the back end of the day was ours in the end but it's probably 60-40 so there's no real lead at the moment," Cosgrove said.
"It was an important partnership between me and Aadil because at that stage of the game we needed to dig in and bat time and knock it around. Aadil has been fantastic for us this year and it's really good to see the young kids come through."
Cotton believes Derbyshire are still in with a good chance of finishing with a victory. "The sun's been on the pitch for three days and it's starting to flatten out a little bit so once you get through the new ball there's not a great deal there although I thought we clawed it back in the last session.
"It's not one of those games that's just going to fizzle out and we are going to try and be aggressive and take it all the way."