Derbyshire 239 and 129 for 1 (Godleman 69*) need another 236 runs to beat Nottinghamshire 324 (Hameed 68, Patel 63, Nash 59) and 279 (Patel 80, Hameed 52)
Samit Patel's highest first-class score since 2017 raised Nottinghamshire's hopes of recording a red-ball victory for the first time in more than two years on the third day of the Bob Willis Trophy match against Derbyshire at Trent Bridge.
The 35-year-old allrounder scored 80 off 94 balls, sharing half-century stands with Joey Evison and Jake Ball, while Haseeb Hameed made 52 to take Nottinghamshire to 279 and set Derbyshire a daunting 365 for victory in four sessions.
They responded well to the challenge with skipper Billy Godleman leading the way with an unbeaten 69 and at the close, were 129 for 1, 236 runs away from what would be a memorable triumph.
The target would have been much lower but for Patel - who is a useful batsman to have coming in at number eight - and for the second time in this match, he played a pivotal innings when the game was in the balance.
After Hameed's patient and determined innings was ended, Notts were 235 runs ahead with three wickets remaining and Derbyshire sensed the door was open if they could finish the innings quickly.
Their bowlers had worked through the middle order after Steven Mullaney had started an overcast morning positively, pulling Sam Conners high into the stand over deep square-leg, before he was caught at wide third slip trying to defend a good ball from Luis Reece.
Peter Trego steered Ben Aitchison to second slip and Tom Moores was hurried into a pull shot by Michael Cohen that Reece held running back from mid-on.
Hameed had been the glue that held the innings together and he fought hard to complete a second half-century in his debut match that should go some way to restoring the confidence he lost at Lancashire.
He had played resolutely through 53 overs but failed to get over a cut at Aitchison and was caught at gully, giving Derbyshire an opening Patel quickly closed with the assistance of Evison and Ball.
Godleman rotated his bowlers but Patel calmly found the gaps and dispatched the bad balls as the lead passed 300. Cohen was driven, cut and pulled for three fours and the eighth-wicket stand was worth 74 when Evison edged Aitchison to second slip.
The 18-year-old has made important contributions with the bat in both innings and Ball also played well for the second time in the game to help Patel add another 55 runs.
Patel drove Matt Critchley for a huge six over long-on but the legspinner kept his nerve and trapped him lbw soon after, and the innings ended in the next over when Cohen had Ball caught behind.
That left Derbyshire chasing what would be their highest winning score against a county side and they started strongly with Reece driving Ball back down the ground for four and pulling him over square leg for six.
But when he whipped Trego to mid-on, Ball dived full length to take a fine catch although it proved to be Nottinghamshire's last success of the day as Godleman and Wayne Madsen settled in.
Goldleman made his intentions clear when Patel was brought on, pulling his first ball for six and sweeping and driving the left-arm spinner for two more fours in the over.
With the pitch offering little, Nottinghamshire know they have a lot to do if they are to taste victory for the first time in a first-class game since they beat Essex at Chelmsford in June 2018.