Gloucestershire 243 for 3 (Dent 102*) trail Glamorgan 433 (Donald 98, Kettleborough 81, Fuller 4-59, Howell 3-28) by 190 runs
Chris Dent compiled an assured 102 not out on the second day of the match against Glamorgan as Gloucestershire's batsmen finally produced the goods in a Championship match at the Bristol County Ground.
Glamorgan posted 433 in their first innings, teenager Aneurin Donald top-scoring with a career-best 98. But Gloucestershire fought back and reached the close on 243 for three, courtesy of a third wicket stand of 137 between Dent and Hamish Marshall.
They still trail by 190 runs, but are handily-placed to avoid a fifth defeat in six red ball matches at Nevil Road, where first-innings runs have been in short supply this summer.
For once, Gloucestershire made a decent fist of batting in the face of scoreboard pressure, Dent finishing the campaign the same way he began it in the opening game at Northants, by scoring a hundred.
Marshall weighed in with an enterprising 58 and Benny Howell contributed an unbeaten 40 as the home side made the most of an easy-paced pitch.
If the first day belonged to Glamorgan batsman Donald, this was definitely Dent's day, the left-hander registering his third century of the summer to extricate his team from a potentially hazardous situation. In the process, he became the first Gloucestershire batsman to register three figures in a Championship match at Bristol this year.
When Will Tavare and Gareth Roderick fell for single-figure scores to Craig Meschede and Michael Hogan respectively, the home side were 32 for 2 and under pressure on a pitch still offering a modicum of assistance to the seam bowlers.
Dent and Marshall summoned admirable resistance in a third-wicket partnership of 137 in 31 overs as Gloucestershire fought back. Marshall required six balls fewer than his partner to reach 50, but the New Zealander was unable to convert his half century into a really imposing total, fending a rising delivery from Hogan to wicketkeeper Chris Cooke.
Dent raised his 50 from 89 deliveries before pressing down hard on the accelerator. He faced a further 65 balls to realise three figures, bringing up that landmark by clipping Meschede behind square leg for four before bad light forced a premature conclusion with 17 overs unused.
Fuller had earlier underlined his value to Gloucestershire, returning figures of 4-59 to lead a spirited fight-back during the morning session. Resuming on 338 for 4, Glamorgan lost their last six wickets for 95 runs.
There was frustration and disappointment for 18-year-old Donald, who fell two runs short of eclipsing Matthew Maynard and becoming Glamorgan's youngest-ever century-maker in the Championship.
The Gorseinon-born batsman had scored a career-best 98 when he chased a wide delivery outside off-stump from Fuller and offered a catch to Dent at second slip. Howell then mopped up the tail, accounting for Meschede, Andrew Salter and Hogan in quick succession to finish with 3 for 28 from 8.3 overs.