Glamorgan 237 (Selman 50, Palladino 4-36) and 0-1 require a further 212 runs to beat Derbyshire 288 (Madsen 70, Milnes 53) and 160 (Reece 55, de Lange 3-53, Salter 3-60)
The spectators who had waited four hours before play started were rewarded for their patience as they saw Derbyshire dismissed for 160 in 44.2 overs, and leave Glamorgan 212 to win. They faced six overs and with the final ball of the day - and without a run on the board - Jeevan Mendis trapped Jacques Rudolph leg before.
Derbyshire meanwhile will be quietly confident of winning only their first championship game since beating Leicestershire in September 2015, as the ball is turning, with Mendis and the 16-year-old off spinner, Hamidullah Qadri, capable of troubling the Glamorgan batsmen.
Resuming at 2 for 0, Derbyshire lost both nightwatchmen in Marchant De Lange's first two overs. Tom Taylor was bowled by the fourth ball of the day, before Tony Palladino was caught at cover point from a leading edge. Billy Godleman, who had batted 43 overs for his 34 in the first innings, counter attacked effectively to score 27 from 22 balls, before he became De Lange's third victim when he parried a lifting ball to gully.
Andrew Salter was introduced when De Lange was rested, and despite being swept for four by Wayne Madsen from successive balls, Salter got his revenge when Madsen prodded to short leg.
Luis Reece held the innings together with a fluent half century which included eight boundaries, but Derbyshire then lost 4 wickets for 16 runs. Graham Wagg removed Gary Wilson and Alex Hughes, while Salter, obtaining enough turn to trouble the batsmen, also took two wickets, including Reece for 55. After a breezy knock from Mendis, the innings ended with Timm Van Der Gugten taking the final two wickets in successive overs.