Mark Footitt produced an explosive spell of fast bowling that blew away Glamorgan and put Derbyshire in sight of victory after two days of the LV= County Championship Division Two match at the 3aaa County Ground.
The 28-year-old showed why he is the country's second-leading wicket-taker with a devastating spell of 5-21 to sweep aside the top order on his way to a career-best 6-48.
Glamorgan had no answer to his pace and hostility and, although the last three wickets added 91, Derbyshire were left needing only 73 for victory and closed on 13 for one after the loss of Billy Godleman.
Michael Hogan took 5-63 but a ninth-wicket stand of 73 between Tony Palladino and David Wainwright gave Derbyshire a lead of 103 to set the stage for Footitt's decisive burst.
The game had been in the balance at the start of play with Derbyshire four runs ahead with four wickets intact and Glamorgan must have fancied their chances of polishing the innings off quickly when Hogan struck twice in his first two overs.
Gareth Cross went to the opening ball of the morning when he was bowled playing no shot and when Alex Hughes had his stumps shattered by the 16th ball of the session, Derbyshire were only nine runs in front.
— Derbyshire CCC (@DerbyshireCCC) July 21, 2014
But Hogan and the rest of the Glamorgan attack could not sustain the consistent lines and lengths that had paid dividends for Derbyshire on the first day, which allowed Wainwright and Palladino to forge the partnership that swung the momentum back to the home side.
Palladino pulled a short ball from Hogan for six over midwicket and an unlikely batting point was secured before the seamer mistimed a drive at Dean Cosker and was caught at mid-off for 33.
But Derbyshire were now 82 in front and there was more frustration to come for the visitors as Footitt flogged Cosker for three fours in five balls before Hogan took his fifth wicket when Wainwright edged into the gloves of Mark Wallace.
Conditions were much easier for batting with blue skies overhead but Glamorgan knew they had to survive the new ball to have any chance of making a game of it. However, their chances were demolished by Footitt.
Will Bragg mistimed a drive to mid-on in the third over and Murray Goodwin felt for one to edge into the gloves of Cross but there was nothing Jacques Rudolph could do against a ball that took off from a good length and hit the top of the bat handle to give Footitt at simple return catch.
— Richard Challands (@Rjchallands1980) July 21, 2014
Chris Cooke was beaten for pace and when Ben Wright was caught behind fending at another rapid, lifting delivery, Footitt had reduced Glamorgan's innings to rubble at 42 for five.
All they could do now was to try to avoid the ignominy of an innings-defeat and Wallace and Jim Allenby gave them hope by adding 41 before Allenby flashed a wide ball from Tom Taylor and was smartly taken at first slip by Wayne Madsen.
When Wallace was undone by some late movement from Taylor, Glamorgan were still 19 behind but Cosker and James Harris at least made sure Derbyshire would have to bat again before Cosker was bowled charging Taylor.
Footitt returned to claim Harris as his final victim for the day when the 24-year-old was caught behind, but some spirited strokes from Hogan and Will Owen held up Derbyshire until Wainwright beat Owen's attempted cut.
Although Godleman was lbw to Hogan for a duck, Derbyshire need only 60 more at stumps and Footitt said: "Everything clicked for me today and it came just when we needed it. I'm just concentrating on doing well for Derbyshire, that's all I can do, keep performing and see what happens."
Glamorgan head coach Toby Radford said: "It's been a disappointing day, Palladino and Wainwright put 70-odd runs on which gave them a lead of a hundred which on this pitch was always going to be significant. It's been tough for two days and we haven't been able to build a big enough lead."