Ben Wright hit a sparkling 125-ball century to give Glamorgan a chance of pulling off an unlikely LV=County Championship victory over Gloucestershire at Bristol.
Replying to the home side's 391, the Welsh county posted 569 for seven by the end of day three, claiming maximum batting points. Wright contributed 123 and Jacques Rudolph, unbeaten on 108 overnight, eventually fell for 139.
Wright's superb innings featured 24 fours and a six. The 26-year-old Lancastrian began the day on eight in a score of 209 for two and batted through the morning session with Rudolph, the pair adding 130 to the total by lunch.
Half-centuries from Jim Allenby and Chris Cooke later cemented Glamorgan's grip on the game as Gloucestershire's bowlers toiled in fierce afternoon sunshine.
By the close the visitors led by 178 and have the opportunity to apply some pressure tomorrow.
The pitch, which had looked bland on day two, offered no more assistance to the bowlers as Rudolph and, particularly Wright, scored quickly from the start of the day.
Wright, who had looked uncomfortable at times the previous evening, hit top form with some sweet timing and moved to a half-century off 71 balls, outscoring his partner.
Their stand of 158 took the score to 343 in the afternoon session before Rudolph departed, caught at third-man advancing to a short ball from Matt Taylor and attempting to uppercut it for six. The opener had faced 266 balls and hit 18 fours and a six.
Wright followed with the total on 370, caught by Ian Cockbain behind square, looking to sweep left-arm spinner Tom Smith. He left the pitch to warm applause and can rarely have played better.
Gloucestershire's efforts to stem the scoring rate and prevent their opponents gaining a meaningful lead were centred around bowling short to a field with as many as three or four players on the leg-side boundary.
Allenby was dropped at mid-off by Benny Howell off Smith on seven and went on to enjoy himself, hitting boundaries off three consecutive balls from Liam Norwell, who conceded 17 from a single over.
It was 475 for four at tea, with Glamorgan 84 in front and Allenby having reached a 75-ball half-century. He fell soon after the interval, caught at deep square off Norwell.
Cooke followed to catch at cover off the same bowler, having made a solid 52 off 111 balls, and Graham Wagg had to retire hurt on five after being hit by a short ball from Taylor.
But Glamorgan moved relentlessly past the 500-mark before Andrew Salter fell leg before to Howell for 19. By then it was clear they were intent on batting through the day.
Glamorgan coach Toby Radford said: "Graham Wagg took a nasty blow on the back of the head and was a bit woozy for an hour or so. But he's back to his normal chirpy self now.
"Ben Wright played beautifully and we are hoping this is an innings he can really kick on from. We will probably bat on for a bit in the morning and then hopefully our bowlers can do some damage."
Director of cricket John Bracewell provided an update on Gloucestershire's injury problems, saying: "Cameron Herring will undergo surgery on Thursday to have a pin inserted in his broken finger and we will be looking to sign a wicketkeeper on loan.
"Michael Klinger's injury has been confirmed by X-rays as a broken toe, but we are not sure yet how long he will be out of action."
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here