Yorkshire recovered well after some early setbacks on the third day of their rain-hit LV= County Championship Division One match against Middlesex at Headingley to set up the prospect of an intriguing finish to the game.
They closed on 130 for five in their second innings to give them a lead of 212 and Middlesex will not find any run-chase easy on a pitch that has constantly assisted the seamers.
If the Tykes achieve a win or a draw on the final day then they will be guaranteed second place in the table in their 150th anniversary year with Durham having claimed the title earlier in the day.
A combination of rain and a wet outfield delayed the start until 3pm, Yorkshire openers Adam Lyth and Phil Jaques resuming on four without loss.
But Lyth bagged a pair to the fourth ball from Corey Collymore, which pinned him lbw, his second such dismissal to the same bowler in the match.
Kiwi Kane Williamson experienced a rare failure in the next over when he was comprehensively bowled by Tim Murtagh and Yorkshire were struggling on seven for two.
Murtagh remained a real problem and with the hosts on 40 he accounted for Jaques thanks to a wonderful catch by Dawid Malan at second slip.
Yorkshire slipped further 10 runs later as Jonny Bairstow was bowled through the gate by a testing delivery from Collymore.
They soon got back on an even keel, however, through an enterprising fifth-wicket stand of 79 between skipper Andrew Gale and Gary Ballance.
Gale, who became the first Yorkshire player to score 1,000 championship runs this season upon reaching 15, saw Ballance dropped at second slip by Ollie Rayner off Murtagh on 12, but the England prospect looked eager for runs and he hurried to a half-century off 47 balls with seven fours.
In rapidly fading light, Gale was plumb lbw to Tom Helm for 40 with the score on 130 for five and the total was unchanged when bad light stopped play, only 30 overs being possible during the day.