PERTH, AUSTRALIA - NOVEMBER 04: Dean Elgar and Jean-Paul Duminy of South Africa walk from the field at stumps on day two of the First Test match between Australia and South Africa at the WACA on November 4, 2016 in Perth, Australia. (Photo by Paul Kane/Getty Images)

South Africa have regained the ascendancy following Australia's batting collapse on the second day of the opening Test.

After starting the day in a strong position, Australia lost 10 for 86 to trump South Africa's first innings total by just two runs.

Dean Elgar and JP Duminy led the charge for South Africa as they finished the day on 2/104, with a lead of 102.

The Aussies looked like having the upper hand after David Warner and Shaun Marsh combined for a 158 opening-wicket partnership, but then the wickets started to tumble.

Warner edged Dale Steyn to slip to fall three runs short of another Test hundred, although moments later the Proteas would lose someone important to them.

During Steyn's next over the paceman pulled up following a delivery clutching his shoulder, and was quickly escorted off to hospital for scans.

Later in the day Steyn was officially ruled out for the remainder of the series, but the visitors had done enough without him to take a lead into day three.

Usman Khawaja, Steve Smith and the Marsh brothers all fell within 14 runs of each other, but the Australia's batting slide didn't stop there.

Peter Nevill and Peter Siddle put up a short fight, but Mitch Starc, Josh Hazlewood and Nathan Lyon all came and went quite quickly to see Australia finish on 244.

The Proteas got off to a decent start, with Elgar and Stephen Cook combining for 35 before Cook was caught by Shaun Marsh on 12.

Hashim Amla was bowled by Hazlewood for 1 and another batting collapse was on the cards, but Elgar and Duminy finished the day with a 58-run partnership, as the pair will re-take the WACA on day three with scores of 46* and 34* respectively.