The former England Under-19 captain put a disappointing season behind him to hit 65 as Somerset ended the third day on 174 for 5 in their second innings - a lead of 179.
Jacques Kallis had earlier completed a fine century to hold the Middlesex first innings together but Mushtaq Ahmed (5 for 66) and Andy Caddick (4 for 71) ensured the visitors had to settle for 236 and a deficit of five.
Kallis was in prime form as Middlesex began on 80 for 3. The South African timed his attacking strokes in glorious fashion amid some solid defence.
After an early examination by Caddick and Graham Rose, Kallis took command, hitting 14 fours in his century made off 158 deliveries. Two balls later he edged Caddick to Piran Holloway at slip, departing for 100.
A fourth-wicket partnership of 96 with Owais Shah (27) looked to be putting Middlesex well on top until the Somerset wicketkeeper Rob Turner ran out Shah. It proved a crucial moment as Middlesex subsided from 150 for 3, adding only 86 more runs as Mushtaq cleaned up the tail. Somerset slumped to 74 for 4 before recovering.Reuse content