Derbyshire 291 and 97 for 2 (Lace 48*, Madsen 41*) lead Gloucestershire 350 (Roderick 98, Higgins 74) by 38 runs
In-form Gareth Roderick narrowly missed out on a century as Gloucestershire scored 350 in reply to Derbyshire's 291 to gain the upper hand on day three of the Specsavers County Championship match at Bristol.
Following hard on the heels of his 115 in the opening fixture against Oxford MCCU a week earlier, the 27-year-old posted 98, adding 118 with Ryan Higgins for the sixth wicket, as Gloucestershire established a useful first-innings lead of 59.
Roderick then took two catches behind the stumps as Derbyshire subsided to 18-2, before Wayne Madsen (41 not out) and Tom Lace (48 not out) ushered them to 97-2 at stumps, 38 ahead with eight second innings wickets in hand.
Derbyshire will almost certainly have to bat for a further two sessions on the final day if they are to secure a draw and much will depend upon the experienced Madsen when he resumes his innings in the morning.
Demonstrating the tenacity and patience required to score runs on a characteristically slow Bristol pitch, Roderick batted for five-and-a-half hours, faced 238 balls and accrued nine fours, in the process helping Gloucestershire bank three batting bonus points on another cold day at the County Ground.
All-rounder Higgins also played his part, raising a forthright 74 from 104 balls and striking 12 fours on a day when the hosts made most of the running.
Derbyshire's bowlers stuck manfully to their task, Luis Reece claiming 3 for 60 and Logan van Beek 3 for 75 to keep their Second Division opponents in check.
Resuming on 202 for 5, Gloucestershire had the better of the morning session, adding 88 runs for the loss of Higgins. The more aggressive of the two batsmen, Higgins was first to raise 50, attaining that landmark from 68 balls with his eighth four, a gloriously-timed cover drive at the expense of Ravi Rampaul.
Content to wait for the bad ball and altogether more cirumspect in his approach, the more cautious Roderick attained the same milestone via 163 balls, driving Reece to the long-on boundary for his seventh four.
Reece afforded Derbyshire temporary respite when bowling Higgins, but Graeme van Buuren and Roderick ensured Gloucestershire were just one run behind at lunch.
Rampaul made a double breakthrough in the afternoon session, pinning van Buuren lbw for 15 and then inducing Josh Shaw to chip to mid-wicket for six as the home side slipped to 325 for 8.
Dutch international van Beek claimed the key wicket of Roderick, who edged a catch behind, and then removed last man Harry Hankins to wrap-up the innings.
Gloucestershire immediately applied new-ball pressure, Reece falling to the second ball of the innings, nicking a catch behind off Matt Taylor without scoring.
Billy Godleman succumbed to Higgins in similar fashion, pursuing a ball that pitched outside off stump and offering up a routine catch behind for 6.
But the watchful Madsen and Lace shut the door on Gloucestershire ambition thereafter, displaying impressive discipline to stage an unbroken alliance of 79.