Paine fights hard but Proteas leave Australia on the ropes
Tim Paine defied a thumb injury to hit a valiant half-century but a wounded Australia side suffered at the hands of South Africa on day three of the fourth Test.
Struggling with a hairline fracture in his right thumb, captain Paine led the way with 62 before the tourists - who had resumed on 110-6 - were bowled out for 221 in Johannesburg.
Proteas captain Faf du Plessis declined the chance to enforce the follow-on, perhaps mindful Morne Morkel had been off the field with an apparent side strain in the morning session, and instead opted to build on a first-innings lead of 267 by batting again.
The hosts made steady but unspectacular progress for the remainder of Sunday's play, reaching 134-3 by the close to extend their advantage to a mammoth 401 runs.
Aiden Markram contributed 37, in the process becoming the second fastest South African to 1000 Test runs, while opening partner Dean Elgar hit a patient 39 not out from 158 deliveries.
Pat Cummins followed up a maiden Test half-century with the bat by taking 2-35, but Australia's hopes of levelling a controversial series overshadowed by the ball-tampering scandal look all but over.
Paine, who suffered his injury while keeping wicket on day two, and Cummins combined in a 99-run stand that defied South Africa, only for the final four wickets to fall for 26 runs either side of the lunch break.
Cummins hit six fours and a solitary six before he was gone for an even 50, eventually given out lbw trying to sweep spinner Keshav Maharaj (3-92) after the home side made good use of the review system.
Nathan Lyon chipped Kagiso Rabada to mid-off to depart for eight while Chadd Sayers failed to open his Test account, top-edging a cut shot off Maharaj to Hashim Amla at backward point as he fell for a duck on debut.
Having reached his milestone in style by slog-sweeping Maharaj over the mid-wicket rope for six, Paine was last man out. In trying to charge Rabada he sliced the ball high in the air, allowing Elgar to turn and sprint towards the boundary from his position at mid-off.
The fielder needed a full-length dive to seize the opportunity with two hands, then immediately ran off the field to signify South Africa would not be putting their opponents back in.
Markram provided early impetus in South Africa's second innings as he reached a notable personal landmark in only his 18th Test knock, just one fewer than compatriot Graeme Smith, before Cummins had the right-hander caught in the slips.
The same bowler removed AB de Villiers for six and while the home side also lost Amla (16), Elgar and skipper Du Plessis - who finished up unbeaten on 34 - turned the screw on Australia.