Middlesex 436 for 6 dec (Malan 177*, Simpson 99*) trail Derbyshire 557 for 6 dec (du Plooy 118, Dal 92) by 121 runs
Dawid Malan kept himself in Ashes contention with a batting master-class to blunt Derbyshire's victory hopes against Middlesex at Derby.
The Middlesex skipper played superbly to score an unbeaten 177 to take his side past the 408 follow-on target as the visitors closed day three on 436 for 6, 121 runs behind.
John Simpson gave him excellent support with 91 not out as the pair shared an unbroken stand of 186, a seventh-wicket record for Middlesex against Derbyshire.
The home side took only three wickets, one of them to Fynn Hudson-Prentice who became only the fifth bowler in Derbyshire's history to strike with his first ball in first-class cricket for the county.
Malan went out to resume his innings knowing a lot rested on him and from the start, he set a tone of defiance with an impressive display of concentration and selectivity.
Apart from a couple of false shots, his judgement of when to play and when to leave the ball was exemplary and although Derbyshire switched their bowlers around, they could not force an error.
Steve Finn fulfilled his nightwatchman duties by staying with his captain for the first 35 minutes of the day before Logan van Beek knocked out his leg stump and although Max Holden struggled, he hung around for 73 minutes.
There was little he could do about the ball that removed him as Hudson-Prentice found late movement to become the first player since John Wright in 1980 to strike with his first ball.
Wright was on the ground to see another memorable moment for the 23-year-old who bowled with control and was unlucky to see Simpson missed in the slips on 21.
George Scott was not as fortunate when he failed to get over a drive at Ravi Rampaul and saw a thick edge fly low to third slip where Matt Critchley took a brilliant diving catch.
At 250 for 6, another 158 runs were needed to avoid the follow-on but Simpson matched Malan's application to take Middlesex to tea and beyond.
Malan completed his third championship century of the season from 200 balls with his 15th four and, Simpson's escape apart, there was little for the bowlers once the second new ball lost its hardness.
Simpson gave another tough chance on 43 when a sliced drive at Reece burst through the hands of Anuj Dal leaping at cover point before he completed a deserved 50 from 138 balls shortly before Malan went to 150 off 302 balls.
Leus du Plooy became the eighth bowler used during the day but nothing could part Malan and Simpson who went past Middlesex's previous best seventh wicket stand of 146 at Lord's in 1932.