PERTH (Reuters) - Paceman Kagiso Rabada took 5-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-nighter 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-8 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-4 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.
Reporting by Nick Mulvenney in Sydney; Editing by Amlan Chakraborty