More sloppy South African fielding and an umpiring howler combined to allow Australia to finish day two in Port Elizabeth in trouble against the home team - but not in the dire straits it should have been in.
The St George's Park pitch the Proteas' batsmen had earlier made look like a featherbed was made to look like a minefield by their bowlers as the visitors faltered badly in their pursuit of 423.
David Warner proved himself the only Australian batsman capable of surviving an early onslaught led by the home team's seamers, producing one of his pluckiest displays of controlled aggression to reach his half-century off just 55 balls.
At stumps on day two, Australia was 4-112, trailing by 311, with Warner on 64 and Nathan Lyon on 12. The latter survived an eight-over stint to end the day in which he was battered by Morne Morkel - but proved he was willing to be bruised if it allowed him to preserve his wicket.
Morkel's seven overs as the home team's first-change bowler were conclusively more menacing than anything done by the Australians in their 150.5 overs in the field. What made him particularly undeserving of his wicketless figures of 0-31 from seven overs was that he managed to elicit an outside edge from Warner, only for century-maker A.B. de Villiers to prove he was mortal by dropping the chance, when Warner was 43 and Australia 3-77, with almost nine overs left until stumps.
The day ended dramatically with Lyon twice surviving deliveries that should have forced him back to the dressing room.
The first occurred when umpire Kumar Dharmasena failed to notice Lyon had clearly nudged Dale Steyn for a leg-side catch for wicketkeeper de Villiers. That South Africa captain Graeme Smith declined to challenge the decision was undoubtedly linked his team losing a review with the second ball of Australia's innings, and the realisation another failure would leave it without any reviews for the following 56 overs, and also that it involved a tailender rather than a specialist batsman.
The second came when Lyon was cramped by returning left-armer Wayne Parnell, who struck twice in his first over in four years, and squeezed a chance to gully where Duminy became the second century-maker to drop a catch. He also missed an opportunity to run-out Michael Clarke for eight, but it only cost his team 11 runs as the Australia captain spooned a catch to cover off Vernon Philander soon after.
Warner's teammates in the top four produced only 13 runs between them as they departed within the first 10 overs of the match, as Warner profited at the other end.
Chris Rogers' barren start to the tour continued when he was trapped leg-before for five in Philander's second over. He was the beneficiary of the second-ball challenge from Steyn to a leg-before decision that was so close that, had the original decision by Richard Illingworth been out rather than not-out, the opener would have been dismissed.
Rogers challenged the later decision by Dharmasena that went against him, the result costing Australia a review because the ball was adjudged to have pitched in line with leg-stump and was due to go on to clearly hit it.
Left-armer Parnell then made a stunning introduction to remove Australia's two best batsmen from last week in Centurion, Alex Doolan and Shaun Marsh, with his first three deliveries. Doolan departed for nine after edging a ball that seamed across him, while the patience that Marsh last week showed was missing as he prodded outside off-stump to a ball that swung away from him, to edge behind for a second-ball duck.
Captain Clarke's encouraging start was not a harbinger of what was to come. After four early boundaries he succumbed to the second ball of Philander's second spell, a dismissal that owed far more to batsman error than bowler skill, in the over after Warner had been given his fifth life in his three innings so far in South Africa.
Despite the still-hefty deficit, it was no surprise to see Warner bullishly congratulating Lyon as they walked off the ground at the end of play, given how much worse Australia's situation could have been.
Earlier, the visitors narrowly avoided enduring their longest stint in the field for the past year as South Africa's first innings stretched for 150.5 overs. The haul of 5-130 from 46 overs by Nathan Lyon was clearly Australia's best bowling effort, with no other bowler managing more than one wicket as the Proteas batted on a pitch that, until the arrival of Morkel late in the day, seemed conspicuously drab.
The home team's total, which was 5-214 at the start of the day, was fuelled by centuries from A.B. de Villiers (116) and J.P. Duminy (123). Their 149-run partnership for the Proteas' sixth wickets included inflicting on Australia its first wicketless full session, to start day two, since the third Test of the winter Ashes series.
After going to tea at 8-413 South Africa only needed to survive for another six overs to surpass India's first innings, in Chennai when the home team was eventually bowled out for 375 in the 155th over, as the longest conceded by Australia in the past year. It was, however, dismissed in the third over after the break. It was the wicket of Duminy that gave tireless off-spinner Lyon the fifth five-wicket haul of his career.
The plaudits for de Villiers continued to flow as he scored his sixth century in his past 12 Tests, a typically chance-less innings. Duminy's milestone, brought up later in the day, was a throwback to the brilliant start he had to his Test career in Australia in late 2008.
Australia fast-bowlers Ryan Harris, Mitch Johnson and Peter Siddle were made to bowl 86 overs between them, a boost for South Africa as it seeks to tire them for both the second innings of this match and next week's series-ending Test in Cape Town.
South Africa (1st Innings - overnight 5-214)
G SMITH lbw b Harris 9
D ELGAR c Harris b Lyon 83
H AMLA lbw b Johnson 0
F DU PLESSIS c Smith b Lyon 55
A.B. de VILLIERS c anb b Lyon 116
Q DE KOCK c (sub) b Smith 7
J DUMINY lbw b Lyon 123
V PHILANDER c and b Clarke 6
W PARNELL c Haddin b Lyon 10
D STEYN not out 4
M MORKEL run out (Smith) 1
Sundries (4b, 4lb, 1w) 9
Fall of wickets: 10 (Smith), 11 (Amla), 123 (du Plessis), 181 (Elgar), 200 (de Kock), 349 (de Villiers), 378 (Philander), 413 (Parnell), 420 (Duminy), 423 (Morkel)
Bowling: R Harris 27-6-63-1, M Johnson 25-5-70-1 (1w), P Siddle 34-9-96-0, N Lyon 46-7-130-5, D Warner 3-0-10-0, S Smith 8-0-30-1, M Clarke 7.5-2-16-1
Australia (1st Innings)
C ROGERS lbw b Philander 5
D WARNER not out 65
A DOOLAN c de Villiers b Parnell 8
S MARSH c de Villiers b Parnell 0
M CLARKE c Elgar b Philander 19
N LYON not out 12
Sundries (3lb) 3
Total (4 wkts - close) 112
Fall of wickets: 7 (Rogers), 41 (Doolan), 41 (Marsh), 81 (Clarke)
Bowling: D Steyn 6-1-33-0, V Philander 6-0-26-2, M Morkel 7-0-31-0, W Parnell 6-2-19-2