A patient half-century from allrounder Jim Allenby helped Glamorgan set Gloucestershire a target of 385 at Cardiff. That was after the home side declared their second innings at tea on 370 for 9.
By the close Gloucestershire had moved on to 42 for no wicket, needing another
343 runs to win on the final day. It was something of a turnaround in fortunes for Glamorgan, who had been 26 for 4 and 54 for 6 in their first innings at the start of the opening day.
Glamorgan had resumed their second innings on the third morning on 185 for 3 - an overall lead of 199. And they were indebted to Mark Wallace and a level-headed approach by Allenby
after they lost both Ben Wright and Will Bragg in the space of four overs.
Ben Wright was run out by a direct hit from Ian Cockbain while Bragg was snaffled at slip off Vikram Banerjee. But Wallace played confidently while Allenby adopted a cool head as the
sixth-wicket partnership added 55 in 21 overs.
Even though Wallace was dropped on 18 and then survived an lbw appeal, and Allenby saw off strong stumping and caught behind shouts, the pair soldiered on to take the Welsh side up to 247. But Wallace was caught on 37, leaving Graham Wagg, who had a runner after
suffering a hamstring injury while bowling on day one, to continue the job of
setting up a winning position.
Glamorgan had moved on to 276 for 6 by lunch but with the ninth delivery with the second new ball Jon Lewis had Wagg caught behind for 19. Allenby, who reached his half-century in three hours from 127 balls with six fours, was joined by James Harris, who made a useful 25 before miscuing Banerjee to point.
Allenby followed six overs later, holing out to cover as he was dismissed for 68 from 158 balls with seven fours. Dean Cosker added a mighty six just before Glamorgan declared at tea.
After the interval, and with four sessions remaining, openers Cockbain and Richard Coughtrie began steadily with the former driving Harris for three fours through the offside.
Cosker entered the attack in the eighth over and immediately posed a few problems for the young openers as Coughtrie nearly spooned a return catch to the slow left-armer, whose first six overs were all maidens. But the Gloucestershire openers survived the final 25 overs, with Cockbain 33 not out overnight.