Glamorgan 131 (C Overton 5-38) and 126 for 5 need another 329 runs to beat Somerset 296 (Davies 81, Brooks 72) and 290 for 8 dec (Abell 119, Green 54, Hildreth 45)
Tom Abell registered his sixth first-class century as Somerset moved to within sight of victory over Glamorgan on the third day of the Bob Willis Trophy match at the Cooper Associates County Ground, Taunton.
Unbeaten on 44 overnight, the home skipper batted through the morning session before finally being dismissed for 119, having faced 167 balls and hit 13 fours and 2 sixes.
With Ben Green, a concussion replacement for George Bartlett, contributing a solid 54, Somerset were able to declare their second innings on 290 for eight, a lead of 455.
At tea, Glamorgan were 29 for 3 in their second innings and facing the possibility of defeat inside three days. But Chris Cooke's battling half-century frustrated the hosts as the Welsh county closed on 126 for 5, still 329 behind.
Only one wicket fell in the morning session after Somerset had set out on 131 for two in their second innings, 296 ahead. It came from the first ball of the day when James Hildreth, on 45, nicked a ball from Michael Hogan through to wicketkeeper Chris Cooke.
That brought in Green, involved because Bartlett had been struck on the head by a delivery Marchant de Lange while batting on the opening day.
It was only the 22-year-old Devonian's third first-class appearance and he showed good temperament to grab the unexpected opportunity with both hands.
Abell moved to a stylish half-century with a back-foot boundary through point off de Lange, having faced 88 balls and hit seven fours. His partner provided sensible support as both batsmen were tested by a probing spell from Graham Wagg in which the experienced left-arm seamer enjoyed no luck.
Green moved steadily past his previous best first class score of 26 and by lunch his partnership with Abell was worth 82, the scoreboard reading 213 for 3.
The afternoon session saw Abell bring up only the second of his first-class hundreds to have been scored at Taunton, successive boundaries off Kieran Bull taking him to three figures off 163 balls.
He celebrated by dispatching the next two deliveries from the off-spinner for six and then hit another four before being caught at deep mid-wicket off the final ball of an over that cost 24.
Green reached his maiden first class fifty off 150 balls, with 4 fours, before becoming the first of several Somerset batsmen to perish in the quest of quick runs before the declaration.
Glamorgan had to face 16 overs before tea and Craig Overton was soon carrying on where he had left off in the first innings.
He sent back Nick Selman, lbw playing no shot for the second time in the game, and Kiran Carlsson, before brother Jamie caught and bowled Charlie Hemphrey for 20 miscuing a pull shot.
Glamorgan looked in disarray at tea. But Cooke and Billy Root then produced a defiant stand of 66 to restore an element of pride.
Having looked comfortable, the pair were parted with the score on 95 when Root inexplicably attempted three reverse-sweeps in the opening two overs from left-arm spinner Roelof van der Merwe.
Having failed to connect with the first two and survived a loud lbw shout, he was bowled trying the third, having made 26.
Cooke played some fine shots to bring up a 76-ball half-century, which featured 8 fours, and was largely content to stick to the textbook as he reached 67 not out by the close.
But Dan Douthwaite fell lbw to a Jamie Overton yorker to end play for the day, leaving his side facing a massive task when play resumes in the morning.