A third-wicket partnership of 250 between Dean Elgar and JP Duminy has ensured that South Africa hold control of the first Test against Australia at the conclusion of day three.
The match in Perth was finely poised at the start of Saturday's play but the two South African batsmen have taken the game away from their hosts with an outstanding performance during the first half of the third day.
The tourists resumed on 104-2 but Elgar and Duminy added another 191 runs before Duminy was finally dismissed for 141 by Peter Siddle after an innings which included 20 fours and one six.
Twelve overs later, Josh Hazlewood did for Elgar but only after the opener had recorded a defiant 127 from 316 balls with his side on 324 at the time of his dismissal.
Faf du Plessis added 32 before the Proteas ended the day with Quinton de Kock (16*) and Vernon Philander (23*) at the crease.
South Africa will resume on day four on 390-6 and with a lead of 388 runs.