Openers Jacques Rudolph and Will Bragg launched a Glamorgan fightback in their LV= County Championship Division Two clash with Surrey but the home side still face an uphill struggle to avoid defeat on the final day at Colwyn Bay.
That was after off-spinner Gareth Batty claimed two late wickets as Glamorgan finished on 182 for two, still requiring 175 to avoid an innings-defeat.
After resuming the third morning on 400 for five in their first innings, Surrey went on to make 589 for eight declared - their second-highest total against Glamorgan - to build up an imposing lead of 357.
Unselfishly skipper Gary Wilson opted to bring a halt to the Surrey innings despite being on 97 not out. Wilson's decision came after a rain break.
Bragg and Rudolph survived the Surrey new ball and then spin from both ends to put on 155 for the first wicket before both perished in consecutive Batty overs.
Earlier, Jason Roy and Wilson looked to accelerate Surrey's 168-run lead but that was halted in the fifth over of the day.
In a mix-up going for a single Roy was run out by Ben Wright at cover. Roy's 70 had come at a run a ball.
Batty and Wilson put on 61 in 16.4 overs before the former was stumped by Mark Wallace off Dean Cosker for 26 the ball after he had dispatched the slow left-armer for six.
— Surrey Cricket (@surreycricket) July 8, 2014
That left Surrey 480 for seven, with a lead of 248. By lunch that had increased to 312 as Wilson and Chris Tremlett built a useful eighth-wicket stand.
Matters did not get better for Glamorgan when Rudolph had to leave the field after receiving a painful blow to the hand attempting a catch off his own bowling.
Tremlett, who has already scored a 90 this season, went to his fifty from 48 balls with a six over square-leg. He fell for 56 in the next over, edging a Will Owen bouncer behind.
Wilson moved closer to a century but was interrupted by rain which left him stranded on 97 with Surrey 589 for eight.
Wilson's selfless declaration meant Glamorgan had to survive 50 overs before the close, with 367 required to make Surrey to bat again. Glamorgan's cause was not helped that Matt Dunn nearly breached Rudolph's defences with the first ball of the innings.
But either side of tea Glamorgan reached 85 for nought from 15 overs, which heralded the spin of Zafar Ansari.
Bragg played positively and the Glamorgan hundred came up in the 19th over.
Rudolph was eventually trapped in his crease for 73 by Batty eight overs before the close. That became 162 for two in Batty's next set of six as Bragg also went lbw for the same score. Batty finished with figures of 2-24 from his 12 overs.