Gloucestershire's New Zealand duo of Hamish Marshall and Kane Williamson helped defy Derbyshire on the final day of their Division Two contest.
Having been made to follow on after trailing by 182 in the first innings, the visitors reached 409-4 when they declared 10 minutes before the start of the final hour.
Williamson moved his overnight score of 106 on to 128 by the time Derbyshire finally managed to see the back of him, Jon Clare getting him caught behind shortly before lunch.
The breakthrough ended a third-wicket stand of 166 with Marshall, who looked at that stage to be on course to score his first century for the county in almost three years.
However, the experienced right-hander fell 10 runs short when seamer Tim Groenewald had him lbw on 90 from the 200th ball the batsman had faced.
Ian Cockbain (63 not out) and Will Gidman (33 not out) comfortably batted out the remainder of the game - wicketkeeper Tom Poynton was the only Derbyshire not to have a go at bowling by the finish.
Kane Williamson's unbeaten century helped Gloucestershire battle back with the bat against Derbyshire on day three at Derby.
The New Zealand international finished proceedings on 106 not out, carrying his county to 219-2 and a lead of 37 after they had been forced to follow on.
Derbyshire had taken the decision to ask their opponents to have another go after Gloucestershire lost their last first-innings wicket to be bowled out for 206 in the morning session, meaning they were still 182 runs behind.
Chris Dent was then bowled shouldering arms to Tim Groenewald with only eight on the board, but the hosts had to wait another 41 overs for their next success.
Opener Benny Howell - released by Hampshire at the end of last summer - made 64, just his second first-class score of 50 or more, as he played his part in a second-wicket stand worth 117.
Jon Clare, who was awarded his county cap just before play began, eventually ended the alliance, only for Hamish Marshall (32 not out) to add a further 92 with Williamson before bad light ended play early.
Tony Palladino took five wickets as Derbyshire turned the screw on Gloucestershire, who tumbled to 172-9 and look to be heading towards the follow-on at Derby.
28-year-old Palladino took 5-47 in 18 overs before rain forced play to be abandoned at 5.20pm leaving the visitors trailing by 216 and still needing another 67 to avoid the follow-on.
Palladino, who took his season's haul to 18 victims, was well supported by Jon Clare's 3-38 which followed his run-a-ball 48 out of Derbyshire's first-innings 388.
Gloucestershire lost Benny Howell to the third ball of their reply but they recovered well to reach 83-1 before the Derbyshire seamers put the home side firmly on top.
They were backed up by keen fielding which was in marked contrast to Gloucestershire, who dropped two more catches before Derbyshire's last wicket went down.
Only Chris Dent offered any solid resistance with his 55, but rain which cancelled out 26 overs of play came to Gloucestershire's rescue and spared them losing even more wickets and following on.
Captain Wayne Madsen scored his first century for almost a year to give Derbyshire a good start to their match against Gloucestershire.
Madsen celebrated his 10th hundred for the county, with Wes Durston and Dan Redfern also adding half-centuries as the hosts closed the first day on 362-9.
Gloucestershire did not help themselves with dropped catches and poor bowling costing them dear - Madsen was spilled badly on 28 while Durston was given a life on nine, and those lapses allowed Derbyshire to recover from the loss of both openers with only 38 on the board.
Paul Borrington went without scoring and Martin Guptill had moved confidently to 30 before he was caught behind off a bottom edge pulling at James Fuller.
Madsen's decision to bat first after days of heavy rain in the Derby area looked questionable, but he and Durston rebuilt and when Madsen was put down shortly after lunch it was the start of a dreadful session for the visitors who conceded 165 runs in 33 overs.
Madsen, who had scored only 64 in his previous five innings this season, brought up his 11th first-class century before going in the next over for 101 when he inside-edged a drive on to his leg stump, and although Derbyshire lost another four wickets before the close, it had still been the home side's day.