Surrey batsman Kumar Sangakkara made his seventh County Championship century in 12 innings, before Yorkshire fought back at The Oval on day two.
The 39-year-old resumed on 85 and went on to hit 164 as the hosts were all out for 592 from their overnight 398-3.
Ben Foakes was out for 110 in a fourth-wicket stand of 258 with Sangakkara.
Yorkshire closed on 171-1, still trailing by 421, with Tom Kohler-Cadmore making 78 and Australia batsman Shaun Marsh 77 not out.
It was a fine recovery from the 2014 and 2015 county champions after Surrey had dominated the morning session with the bat.
Sangakkara is set to retire from first-class cricket at the end of this campaign - a season in which he has arguably shown the best form of his 20-year career.
His statistics are staggering. He has 1,250 County Championship runs at an average of 113.63, with seven hundreds and two fifties in 12 knocks.
While most of his scoring strokes are about pure timing and placement, Sangakkara has also cleared the rope 12 times in 2017 - the most of any Surrey batsman.
The former Sri Lanka batsman struck three sixes in the first session, including a huge straight maximum off seamer Tim Bresnan, as he took the attack to Yorkshire's bowlers along with Foakes.
By the time Sangakkara holed out to fine leg off Jack Brooks (5-113), the pair had added 115 runs in 20.5 overs in the morning to take Surrey past 500.
However, Yorkshire demonstrated what a fine batting pitch it was, meaning a 10th draw of the season could be on the cards for Surrey.