Gloucestershire captain Michael Klinger registered his fourth LV= County Championship century of the summer to set up a potentially thrilling finish on the final day of the Division Two match against Kent at Cheltenham.
Klinger posted an unbeaten 102 as Gloucestershire made 237 for one declared in their second innings, meaning the South Australian has now scored more than 1,000 runs in all cricket this season.
Bottom-of-the-table Kent will bat tomorrow having been set a target of 411 to win in a minimum of 96 overs.
Klinger and Kent skipper James Tredwell struck a deal during the lunch interval, contriving imaginative declarations in order to arrive at a meaningful finale.
Although only nine wickets had fallen in seven previous sessions, unsuspecting festival-goers still looked mystified when Kent declared their first innings on 389 for five in the 101st over, forfeiting a fifth batting bonus point in favour of giving themselves an opportunity to win a four-day game for the first time in nine attempts this season.
Having agreed not to enforce the follow-on, Gloucestershire commenced their second innings 173 runs ahead with the intention of setting Kent a target to chase on the final day.
Chris Dent picked up where he had left off in the first innings, playing shots all around the wicket and threatening a second successive century, albeit it against declaration bowling.
In the circumstances, the Bristolian was doubtless bitterly disappointed to offer occasional spinner Sam Northeast a return catch after rushing to 82 from 75 balls and helping himself to 13 fours.
Having served as junior partner in an opening stand of 151, Klinger accelerated during the final hour to raise three figures from 118 balls with nine fours and a six.
Ben Harmison earlier became the fourth batsman to post a hundred on a flat College Ground pitch, the all-rounder reaching the landmark from 141 balls in a near-faultless innings that included 12 fours and a six.
He shared in stands of 103 and 74 with Darren Stevens and Geraint Jones for the fifth and sixth wickets respectively and helped guide the visitors clear of danger after they had slipped to 212 for four in the morning session.
Brendan Nash was bowled off his pads by left-arm spinner Tom Smith when sweeping for nine, while Northeast was brilliantly caught down the leg side by wicketkeeper Gareth Roderick off Craig Miles just six runs short of a century.
But veteran county campaigner Stevens regained the momentum, crashing 75 runs off 71 balls in a forthright innings that yielded nine fours and two sixes.