Perth: Paceman Kagiso Rabada took five for 92 as South Africa completed an emphatic 177-run victory over Australia in the first Test at the WACA on Monday after dismissing the hosts for 361 just before tea on the final day.
The tourists claimed a third successive victory at the WACA after 2008 and 2012 triumphs and a 1-0 lead in the series, which continues in Hobart on Saturday and concludes with a day-night match at Adelaide Oval.
Australia's batsmen were unable to cope with Rabada's pace and swing as the 21-year-old took his fourth five-wicket haul in his ninth Test, making light of the absence of South Africa's injured pace spearhead Dale Steyn.
It was Australia's first Test defeat at home since that 2012 loss at the WACA and there was more bad news at the end of the day when it was confirmed that opener Shaun Marsh had broken his finger and would not play in Hobart.
South Africa declared on 540 for eight after lunch on Sunday, leaving Australia with an imposing 539-run victory target or more realistically almost five sessions to bat out for a draw.
It was a remarkable turnaround after Australia, having dismissed South Africa for 242 on day one, were 158 without loss before collapsing to 244 all out.
"We had some harsh words at the end of day one, we were very disappointed with how we played, and we wanted to come back and put in a real solid performance," said South Africa captain Faf du Plessis.
"The way we responded was quite ridiculous, it was incredible the way we turned it around and we backed it up on day three. Since day one, it's just been unbelievable."
Australia had resumed on 169 for four on Monday and Usman Khawaja, Mitchell Marsh and Mitchell Starc were dismissed before lunch with Peter Siddle following after the break.
Peter Nevill, who finished on 60 not out, and Josh Hazlewood stalled the march to victory with a dogged partnership of 65 before Australia's number 10 batsman was dismissed for 29 to give Temba Bavuma his maiden Test wicket.
Nathan Lyon extended the tail further with a 21-ball eight before he was trapped in front by debutant spinner Keshav Maharaj to conclude the match.
"Disappointing," said Australia captain Steve Smith. "We need to try and let this performance go and come out in Hobart and try and turn it around.
"We're going to have to play better cricket against a quality South African team if we're going to do it."
Khawaja had provided the most spirited resistance for much of the innings and after he fell lbw to JP Duminy's part-time spin three runs shy of his fifth test century, Australia's already tough task looked all bar impossible.
Man of the Match Rabada accounted for Mitchell Marsh (26) and Starc (13), both lbw, to take his match tally to seven wickets.
Bavuma, whose brilliant run out accounted for opener David Warner on Sunday, almost claimed another key victim with his first delivery in Test cricket.
Khawaja, on 84, was plumb lbw after the ball hit a crack and thudded into his front pad but the 26-year-old had overstepped the mark and umpire Nigel Llong called a no-ball.
Lefthander Khawaja had started the morning on 58 and continued to display the same grit and determination that got him through to the close on day four, hitting 11 fours and three sixes in his 182-ball knock.
Duminy's first delivery skidded into Khawaja's back pad, however, and the 29-year-old became the second Australian batsman to perish on 97 after Warner in the first innings, the wicket that triggered the collapse.
South Africa 1st innings: 242
Australia 1st innings: 244
South Africa 2nd innings
540 for 8 declared
Australia 2nd innings
S. Marsh c du Plessis b Rabada 15
D. Warner run out 35
U. Khawaja lbw Duminy 97
S. Smith c de Kock b Rabada 34
A. Voges c de Kock b Rabada 1
M. Marsh lbw Rabada 26
P. Nevill (not out) 60
M. Starc lbw Rabada 13
P. Siddle lbw Philander 13
J. Hazlewood c Elgar b Bavuma 29
N. Lyon lbw Maharaj 8
Extras (b-13, lb-11, nb-2, w-4) 30
Total (all out, 119.1 overs) 361
Fall of wickets: 1-52, 2-52, 3-144, 4-146, 5-196, 6-246, 7-262, 8-280, 9-345.
Bowling: K. Rabada 31-6-92-5 (w-3); V. Philander 22-7-55-1; J. Duminy 17-1-51-1; K. Maharaj 40.1-10-94-1 (w-1); S. Cook 2-0-16-0; T. Bavuma 7-1-29-1 (nb-2).
Umpires: Aleem Dar, Nigel Llong
TV umpire: Richard Kettleborough
Match referee: Andy Pycroft