Skipper Andrew Gale scored a season's-best 126 not out as Yorkshire batted all day to earn a commanding lead over Middlesex in the County Championship match at Scarborough.
The hosts closed the third day on 400-5 in their second innings with an overall lead of 421 and if they go on to bowl out their opponents they will return to the top of the Division One table.
Resuming on 29-1, Yorkshire made rapid progress through Kane Williamson and Alex Lees who batted throughout the morning session while adding 117 in 31 overs.
Lees was 66 and Williamson 62 when lunch arrived at 146-1 but both fell quickly in the afternoon, Williamson cutting the second ball from Tim Murtagh to be well held one handed above his head by Ollie Rayner in the slips. Murtagh also had Lees (67) caught in the cordon, this time low down by Dawid Malan.
Jonny Bairstow (32) was caught by Tom Helm with the score on 201. A solid partnership then developed between Gale and Jack Leaning.
Gale was in the wars when he deflected a Steven Finn delivery on to his left elbow on 97 but he was soon acknowledging his century which came off 162 balls and contained 10 fours. His ton followed hard on the heels of Leaning's 50 from 130 balls with three boundaries.
In attempting a big hit off Dawid Malan, Leaning was stumped for 76 to end a fifth-wicket partnership of 182 with his captain, who closed on 126 from 180 balls with 13 fours.
Elsewhere, a fourth-wicket stand of 174 between Luke Wright and championship debutant Craig Cachopa gave Sussex first-day honours against Warwickshire at Horsham.
Both fell in the 80s as Warwickshire fought back by taking four wickets for 19 runs with the new ball, but Sussex were relatively pleased to finish on 314-7 after winning the toss and taking first use of a pitch offering assistance to the seamers.
Openers Luke Wells and Chris Nash had given Sussex a solid start with a stand of 68 when Wells was superbly taken by Tim Ambrose diving to his right to intercept an inside edge.
There was a rare failure for skipper Ed Joyce, who was caught behind driving expansively at Keith Barker while Nash, having reached his third half-century of the season, was trapped lbw to Barker trying to work an inswinger to the leg side.
South Africa-born Cachopa showed a determination to graft after a sketchy start when he hit several balls in the air. He struck 10 boundaries in his half-century, reaching the landmark in the same Jeetan Patel over as his partner, just before tea.
Chris Woakes found some extra bounce just short of a length to have Cachopa caught at waist height by second slip with the score on 294. Wright then chased a wide delivery from Keith Barker and he under-edged to Ambrose for 89.
Steffan Piolet, working a Woakes delivery to leg, unluckily trod on his own stumps before England all-rounder Chris Jordan, in only his third Championship appearance of the season, was bowled by Rankin off a bottom-edged pull.