Port Elizabeth, March 10: South Africa suffered a final-session collapse to finish on 263 for seven, with a lead of just 20, at the end of an eventful day two in the second Test against Australia.
Dean Elgar and Hashim Amla both made battling half-centuries but the hosts, 0-1 down in the series after a 118-run defeat in Durban, lost five wickets after tea in Port Elizabeth.
AB de Villiers hit an unbeaten 74 to at least push the Proteas ahead, though their hopes of a sizeable first-innings advantage now rest largely on the shoulders of their former captain, who earned valuable support from Vernon Philander (14 not out) late on Saturday.
However, the action was overshadowed by events away from the pitch, including Cricket South Africa issuing an apology to Cricket Australia after an incident involving two of their employees being photographed with fans wearing Sonny Bill Williams masks in an apparent attempt to embarrass David Warner.
There was also an issue raised about the brass band at St George's Park, with umpires Kumar Dharmasena and Chris Gaffaney complaining the noise levels were hampering their hearing out in the middle.
Kagiso Rabada made 29 with the bat in the morning but will anxiously await the result of a disciplinary hearing on Sunday, the bowler appealing against a code of conduct breach following an incident on the opening day.
Rabada, who was bowled by Pat Cummins off an inside edge, was charged with a Level 2 offence after a shoulder brush with Australia captain Steve Smith, putting him at risk of a ban.
After the departure of South Africa's nightwatchman, Amla (56) joined Elgar (57) to form a third-wicket alliance worth 88, the former twice using the review system to overturn lbw decisions given out on the field.
Yet the pair struggled to keep the scoreboard moving in the afternoon and, after just 43 runs were added in a turgid second session, the tea break triggered a flurry of wickets.
Amla was the first to go, bowled by a Mitchell Starc delivery that moved away late, before Elgar fell in the next over, edging Josh Hazlewood through to wicketkeeper Tim Paine.
Mitchell Marsh then trapped Faf du Plessis and Theunis De Bruyn lbw for nine and one respectively, while Australia's decision not to take the second new ball immediately was vindicated when Nathan Lyon bowled Quinton de Kock.
De Villiers and Philander held firm thereafter, though, and will hope to add significantly to South Africa's currently slender lead on day three.