Michael Klinger played a captain's innings to steer Gloucestershire away from trouble on the second day of the LV=County Championship Division Two match against Glamorgan at Bristol.
Murray Goodwin scored a hundred and Mark Wallace and Michael Hogan weighed in with 94 and 51 respectively as Glamorgan posted an imposing 448 in their first innings.
Gloucestershire skipper Klinger then served up defiance aplenty, batting through two sessions for 80 not out and staging crucial partnerships with Gareth Roderick and Dan Housego as the home side reached the close on 179 for one, still 269 runs behind.
Yet the 33-year-old Australian was forced to ride his luck and was twice dropped in the slip cordon. He had just four when he was put down by Jim Allenby off Hogan and enjoyed another let-off on 36 when Stewart Walters fumbled what should have been a regulation catch to frustrate Michael Reed.
Klinger certainly made the most of those escapes, raising 50 from 122 balls to afford the innings a solid base.
Wicketkeeper Roderick fully justified the decision to promote him to open the batting in the absence of injured left-hander Chris Dent, contributing 41 runs and six fours in a stand of 79 with Klinger.
A half-century appeared to be his for the taking, only for Western Australia paceman Hogan to pin him lbw on the front foot shortly before tea.
But Klinger and Housego proved immovable thereafter, the former safely negotiating 191 deliveries and the latter offering staunch support to reach the close unbeaten on 46 from 118 balls. The unbroken second-wicket stand is worth exactly 100.
Goodwin earlier registered his 68th first-class hundred as Glamorgan, resuming on 318 for five, added 130 more runs in an eventful morning session.
Released by Sussex after passing 50 on only two occasions last season, the 40-year-old held sway for five hours, reaching three figures for the first time since joining his new county.
Particularly effective playing off the back foot, he cut and pulled his way to 12 fours in a patient innings of 108 that spanned 221 balls and was finally terminated when he became the first of three batsmen to fall to Craig Miles in the space of seven balls as the visitors slipped from 339 for five to 343 for eight.
But Glamorgan skipper Wallace and Hogan slammed the door shut on Gloucestershire in a whirlwind alliance of 68 in 11.1 overs, the latter raising his maiden first-class fifty from 48 balls and smiting eight fours and a six in the process.
Wallace was last man out and finished six runs short of a century, having negotiated 118 balls, hit 14 fours and a six, staged partnerships of 68, 69 and 37 with Goodwin, Hogan and Reed for the sixth, ninth and 10th wickets respectively and helped Glamorgan bank four batting bonus points.
Gloucestershire academy product Miles returned figures of 5-83 and now has 25 wickets in five championship outings since breaking into the side last month.
He was aided by left-arm seamer David Payne, who plugged away to finish with 3-87, including the wicket of Wallace, while 17-year-old off spinner Miles Hammond claimed his first victim in championship cricket when Hogan holed out to long-on.