South Africa masterminded an extraordinary collapse as Australia slumped from 158/0 to 244 all-out to let the visitors claw their way back in the first Test on day two in Perth. The Proteas finished the day at 104/2, with Dean Elgar (46 not out) and JP Duminy (34 not out) going strong, handing their side a lead of 102.

The manner of Australia's capitulation was identical to their poor displays in Sri Lanka. There, it was their weakness against spin that was exposed. Here, it revealed a soft core. Perhaps, this was exactly what Dale Steyn meant when he said his team would have to go for the "head of the snake".

Australia's head, Steven Smith. was dismissed for a duck in one of the more bizarre leg-before decisions in recent times. Smith had stepped out of the crease by a foot to attack spinner Keshav Maharaj, but the umpire still thought that ball was hitting the stumps.

That was South Africa's turning point and they never looked back from there when, even in the first hour, there was little that suggested that their fortunes were going to change from Thursday. Shaun Marsh dropped anchor and Warner continue to chase after anything that was within his range, before Steyn walked off with yet another chastening shoulder injury.

Before being injured, Steyn dismissed Warner. The Australian vice-captain was three runs short of his hundred and he flashed his bat against a delivery that drifted slightly outside the off-stump, before Hashim Amla took a safe catch at slip off the nick. The first-wicket stand had accounted for 158 runs. Between Warner and Smith's dismissals, Kagiso Rabada had yorked Usman Khawaja, uprooting his off-stump.

Maharaj was a delight to watch and Faf du Plessis backed the left-arm spinner by attacking the batsmen with men around the bat. Rabada came at the batsmen with speed and bounce, but Philander was easily the pick of the bowlers with his nippy pace. The medium-pacer got the ball to seam both ways and caused havoc in the Aussie ranks.

In reply, Australia landed a couple of early breakthroughs. Stephen Cook was caught superbly at short mid-wicket by Shaun Marsh and Amla, yet again, fell cheaply to Josh Hazlewood. Just when the momentum was swinging back in Australia's favour, Elgar and Duminy saw out the early danger and judiciously chose their scoring shots.

Mitchell Starc was bowling a hostile spell, but his bowling strategy was high on intimidation and less wicket-taking. Elgar used his feet well to hit Nathan Lyon out of the attack, while Duminy looked in excellent touch in the final hour of the day, scoring boundaries all around the wicket.

Brief score:

South Africa 242 (Quinton de Kock 84, Temba Bavuma 51; Mitchell Starc 4/74, Josh Hazlewood 3/70) & 104/2 (Dean Elgar 46 not out, JP Duminy 34 not out; Peter Siddle 1/12) lead Australia 244 (David Warner 97, Shaun Marsh 63; Vernon Philander 4/56, Keshav Maharaj 3/56) by 102 runs.