Somerset's LV= County Championship Division One match against Yorkshire looked to be heading for a draw after their batsmen dominated the third day at Taunton.
Replying to the visitors' 450, Somerset reached 530 for nine at the close - a lead of 80 - with Johann Myburgh contributing 91 and Lewis Gregory hitting a career-best 69.
Starting the day on 166 for three, New Zealander Kane Williamson struck with his off-spinners two balls into his spell to get Alviro Petersen caught behind for 24 after the South African had shared 71 for the fourth wicket with James Hildreth, who went on to pass 11,000 first-class runs.
Hildreth was trapped lbw by Jack Brooks for 67, scored from 104 deliveries, with the second new ball, leaving the hosts on 252 for five, before Craig Kieswetter and Myburgh both struck half-centuries to remove the threat of the follow-on.
They came together before lunch and shared a sixth-wicket stand of 112 before Kieswetter was caught at slip by Adam Lyth off Williamson for 63, a knock that included two sixes.
Ryan Sidebottom and Steven Patterson shared five maidens on the trot immediately after lunch but Somerset continued to make the most of a batsman-friendly track and perfect conditions.
Ex-Durham batsman Myburgh went on to reach 91 off 153 balls, his best in county cricket, and with Gregory guided Somerset into a first-innings lead.
Gregory became the fifth Somerset batsman to make a half-century today as he went on to a 91-ball 69, including two sixes over long-on against Adil Rashid and Lyth either side of tea, while Craig Meschede ended the day on 45 not out.
Liam Plunkett was the most successful bowler, claiming figures of 4-108 from 26 overs, but Yorkshire collected only one bowling bonus point.