Glamorgan 25 for 4 (Helm 4-8) trail Middlesex 384 (Malan 166, Sowter 57*, Roland-Jones 54) by 359 runs
Dawid Malan, the Middlesex captain, again led from the front as Middlesex recovered from 131 for 6 to reach 384 in their first innings. Malan scored 166 of those runs - his fourth Championship hundred this summer, his third score over 150 and taking his season's tally to 933 runs.
Malan was well supported by the tail, with Toby Roland-Jones scoring a half-century and Nathan Sowter a career-best 57 not out batting at No 10.
In reply, Glamorgan were in disarray on 25 for 4 at the close on a day where the seamers obtained plenty of movement from a well grassed Sophia Gardens pitch, but apart from Michael Hogan and Lukas Carey the other Glamorgan bowlers were wayward and failed to advantage of the conditions.
Tom Helm wrecked the Glamorgan top order by taking 4 for 8 from his opening four overs, which included the wicket of Marnus Labuschagne, who has scored more than 1000 championship runs this season.
Malan did not exercise his right to field first and might have regretted his decision when Middlesex lost four wickets in the opening session. Sam Robson and Nick Gubbins both edged catches off Lukas Carey, who bowled a useful opening spell of 7-1-20-2.
Stevie Eskinazi struck 36 in quick time, but Graham Wagg, after an opening over that cost twelve runs, made amends in his second over when his second ball was deflected to wicketkeeper Chris Cooke, who took a tumbling catch.
George Scott soon departed, leg before to Michael Hogan playing no stroke, but Malan was confident from the start and, partnered by John Simpson, began his team's recovery they put on 58 for the fifth wicket.
Malan, however, should have been out on 43, when, in the first over after lunch, Carey found the edge of his bat only to see the ball dropped by David Lloyd at first slip. It proved a costly miss as Malan and Roland-Jones shared a 90-run partnership.
Roland-Jones was inches away from playing on from his first ball, but then settled to strike some lusty blows and scored 54 from 81 balls, including a six and nine fours.
There then followed the best partnership of the innings as Malan found an unlikely ally in Sowter, whose previous best was 37. Playing some unorthodox shots he raced to 50 from only 40 balls, twice carving Marchant De Lange over the short cover boundary for six as the ninth wicket pair put on 103 from just 77 balls.
After scoring 57, Sowter was struck on the hand by Wagg, and immediately left the field but, after Tim Murtagh was dismissed, he returned to resume his partnership with Malan. He did not face another ball, however, as Malan was caught on the boundary for an innings that included three sixes and 22 fours.
Glamorgan had to face nine overs at the close, but soon lost Nick Selman and night watchman Carey in Helm's second over, and when Labuschagne and Charlie Hemphrey went in the penultimate over, the follow-on figure of 235 seemed a long way away.