Glamorgan stopped just short of dealing the ultimate blow to wounded Surrey pride when they declared on 702 for eight - only 16 shy of equalling their all-time highest total in the County Championship.

For the second time this summer, four visiting batsmen hit centuries in an innings at The Oval, as Mark Wallace and James Allenby emulated the day two centuries from Mark Cosgrove and Gareth Rees.

Glamorgan amassed their highest score of the season to gain a first-innings lead of 272.

The foundations for the huge team innings was the opening stand of 315 in 72 overs between Cosgrove and Rees - the third highest first-wicket partnership ever against Surrey.

After toiling for four-and-a-half hours to break the alliance, Surrey finally achieved success 13 overs into day three with a run out.

Rees, on strike against the leg spin of Chris Schofield, turned the ball to square leg and set off for a risky single, but Cosgrove was short of his ground as Stewart Walters' throw reached wicket-keeper Jonathan Batty.

Cosgrove went for 175, but Rees remained to reach 150 from 227 balls for a career-best with 22 fours.

But after cracking one more boundary through cover off the bowling of Jade Dernbach, Rees was out for 154, edging a push drive to Batty to make it 368 for two just before lunch.

Surrey, who were struggling to defend the long Oval boundaries set for this game, hit back in the mid-session by taking three Glamorgan wickets for five runs in the space of 23 balls.

Michael Powell (12) fenced to second slip where Walters held a stunning one-handed catch to his right to give Richard Logan a maiden championship wicket for the Brown Caps, then Will Bragg (33) flashed hard at a wide one from Chris Jordan to again see Walters pull off a fine catch at second slip.

Surrey's purple patch ended after Jamie Dalrymple dragged onto off stump when trying to force through the covers to give Jordan his second scalp.

Normal service was resumed by Glamorgan's batsmen, as Wallace and Allenby set about posting a club-record sixth-wicket stand against any county worth 240, beating the previous best created by Willie Jones and Len Muncer against Worcestershire at New Road in 1953 by 10 runs.

Wallace reached his hundred, his second of the summer and fifth of his career, from 105 balls to become the fifth left-hander in the match to reach three figures.

Wallace's fun ended when he went lbw to Rangana Herath for 139, and the same bowler accounted for Allenby, - but not before he had recorded a 142-ball ton, his first for the Welsh side since joining on loan from Leicestershire.

Allenby's dismissal for 137 sparked Dalrymple's declaration just after 5pm, but weary Surrey were unable to survive the seven remaining overs without incident.

In the day's penultimate over, Michael Brown (17) padded up to a Garnett Kruger off-cutter that nipped off the seam to peg back off stump.

Surrey will need to score a further 248 on the final day to make Glamorgan bat again, but a win for the visitors seems the more likely outcome on the final day of the championship season.