Derbyshire captain Billy Godleman felt his side had enough skill to take the 10 wickets needed against Gloucestershire - but needed more runs on the board.
But it wasn’t to be as James Bracey hit an unbeaten century as Gloucestershire pulled off a thrilling run chase to beat Derbyshire by eight wickets and boost their promotion hopes.
Bracey scored 116, skipper Chris Dent made 62 and Gareth Roderick 48 from 34 balls as they overhauled a target of 263 from 49 overs to move to second in Division Two.
Derbyshire had declared on 481 for 6 with Tom Lace scoring 125 and Leus du Plooy 67, but Gloucestershire timed their chase to perfection to all but end the home side’s slim promotion ambitions.
Godleman said: “Although the Gloucester guys played really well in the fourth innings we probably needed a few more runs to defend in the end.
“We did think there was enough skill in our armory to take the 10 wickets and with it being a day four wicket there was quite a bit of rough there but they played really well.”
All results were possible at the start of day four with Derbyshire 86 ahead with seven wickets intact and needing to strike a balance where they could get in a position to try and win the game without losing early wickets.
Gloucestershire’s bowlers had toiled with little reward for much of the previous day and it was another fruitless morning for them as Lace and du Plooy accumulated steadily on a pitch that was still a good one for batting.
The closest they came to breaking the stand before lunch came 50 minutes into the morning when Lace on 82 survived a hard, low chance to cover but that was a rare blemish in what was another impressive innings from the on-loan Middlesex batsman.
The 21-year-old had already scored centuries at Swansea and Kidderminster this season and his first at Derby came from 195 balls, reinforcing the impression that he is a player to watch.
Derbyshire’s need to press on after lunch resulted in him edging a swing at Ben Allison and du Plooy drove Tom Smith to mid off as the home side trod on the accelerator.
Harvey Hosein lofted Allison for three fours in an over and Ravi Rampaul hit two big sixes before the declaration came, challenging Gloucestershire to make their highest successful run chase against Derbyshire.
Dent and Bracey took no risks in the 12 overs up to tea although Bracey survived a fierce chance on 21 to Lace who injured his left hand and immediately left the field in considerable pain.
Derbyshire went with spin from both ends after tea and Dent and Bracey raised the tempo with Dent driving Matt Critchley for six to reach 50.
Gloucestershire went into the last 20 overs needing 143 but when Rampaul returned to the attack, Dent cut his second ball to point.
Bracey kept his side in the hunt with some improvised strokes and Gareth Roderick swept Critchley for six and reverse-swept two more fours to bring the target down to 60 from 10 overs.
Roderick drove Critchley to long off in the 42nd over but Ryan Higgins swept the leg-spinner for six as Gloucestershire sealed a 23 point haul with 11 balls to spare.