Skipper Faf du Plessis hailed one of the best wins of his career after Kagiso Rabada's five-wicket haul led South Africa to a remarkable turnaround victory in the first Test against Australia on Monday.

Set a mammoth victory target of 539, the home side's second innings ended on 361 on the final day, handing the visitors victory by 177 runs and maintaining their unbeaten record in four Tests at Perth's WACA Ground.

The victory looked unthinkable when Australia were 158 for none early on day two in reply to South Africa's 242, and especially when the visitors lost strike bowler Dale Steyn to a shoulder injury.

Source: b'A historic win for South Africa. Reuters'

Debutant spinner Keshav Maharaj (1-94) delivered the final blow, trapping number 11 Nathan Lyon lbw for eight, the decision upheld despite an Australia review and leaving Peter Nevill unbeaten on 60.

It was Australia's fourth successive Test defeat, after being beaten in all three Tests on their July-August tour of Sri Lanka, and the first time they had lost the opening Test of their home season since 1988.

"That's one of the most special days, to turn it around 360 degrees from day one where we were under the pump," du Plessis said of day two.

"We were a seamer down pretty much the (whole) Test match and we always joke that if you are a seamer down in a three-seamer attack, it is 99 percent impossible.

Source: b'Rabada (C) got 5-92, a MoM-winning performance. Reuters'

"Somehow we managed to do it and much of the credit goes to this man (Rabada) and also Keshar (Maharaj).

"That is right up there with the best match in my Test career."

Australian captain Steven Smith lamented the way his side failed to capitalise on its early dominance.

"The most disappointing thing from my aspect was we were in a position to be able to drive the game," he said.

"We had another big collapse and we weren't able to capitalise on what the openers did to put us in a great position.

"Every aspect of our game needs improving."

Resuming at 169 for four, a draw was Australia's only hope and it appeared a forlorn task, with man-of-the-match Rabada ensuring that was the case with 5-92.

With star paceman Steyn suffering a shoulder injury that will sideline him for at least six months, Rabada stepped up in fine style to lead the South African attack.

The 21-year-old claimed three wickets on day four and two more on Monday to record his fourth five-wicket haul in just nine Tests, a record for a South African player of his age.

Feature image source: PTI