Middlesex were facing an uphill struggle to avoid a defeat that would damage their title hopes after Derbyshire dominated the second day of the LV= County Championship Division One match at Derby.
Tim Groenewald hit 49 off 48 balls as Derbyshire's last two wickets added 101 in 12 overs. He then removed both Middlesex openers as the visitors collapsed to 197 for six, with seamer Matt Higginbottom taking 3-51 in his second championship game.
Derbyshire skipper Wayne Madsen made an unbeaten 138 out of 385 and, although Adam Voges made 69, Middlesex were in trouble at the close, still 188 runs behind.
The visitors would have expected to keep Derbyshire under 300 after Tim Murtagh snared his 50th championship victim of the season and James Harris struck in the first two overs of the day - but the wheels came off as Groenewald plundered some woeful bowling.
When Peter Burgoyne steered the fifth ball of the morning to gully and Higginbottom turned Harris to square-leg, Derbyshire were 284 for eight - but the bowling subsequently wilted in the face of Groenewald's onslaught.
Groenewald made a mockery of his batting average of six this summer with some crunching drives that earned the home side two extra bonus points.
By the time Ollie Rayner had the 29-year-old caught at the wicket, he had smashed nine fours and dominated a stand of 66 in 12 overs with Madsen - but there was more frustration to come for Middlesex as Mark Footitt hit 19 off 16 balls.
Derbyshire then carried the momentum the tailenders had given them into the field when they removed Sam Robson before lunch.
The opener completed 1,000 championship runs for the season but then got a good ball from Groenewald which lifted and induced an edge to second slip.
Groenewald struck again in the second over after the interval as Joe Denly drove loosely and was caught by Shivnarine Chanderpaul leaping to his right at short extra-cover.
At 25 for two, the follow-on target of 236 was a long way off and Middlesex's position would have been even more serious if Richard Johnson had held two difficult catches at second slip when Voges had 16 and Eoin Morgan 25.
Morgan did not profit from his escape and three overs later slapped Higginbottom to point, where 15-year-old Callum Brodrick, on for Chanderpaul, held the catch to dismiss the England batsman for 28.
Voges reached 50 off 139 balls but Middlesex were in trouble when they lost three wickets in 29 deliveries to slip to 154 for six.
Neil Dexter was bowled by a full-length ball from Footitt, while Higginbottom had Voges lbw before striking again as Gareth Berg played on.
John Simpson and Rayner survived 15 overs and added 43 runs but Middlesex were still 39 short of avoiding the follow-on at the close.