Kagiso Rabada once again put South Africa on the front foot when he removed Usman Khawaja as Australia finished the third day of the second Test on 180-5.
Khawaja, who has struggled for runs in this series, scored a valuable 75 at a time when Australia really needed him to step up.
The 87-run partnership between Khawaja and Mitchell Marsh got Australia back into the game, but South Africa will feel they’re on top going into day four on Monday.
The Australian No 3 batsman, along with Marsh, had frustrated South Africa with their stubborn stand that saw them put the visitors in the lead, having previously been in trouble at 86-4.
The third session began with Australia on the back foot having lost Steve Smith, David Warner and Cameron Bancroft when Shaun Marsh joined Khawaja in the middle.
But Australia were soon four down when Rabada had the older Marsh caught behind by Quinton de Kock for just one run in the first over after tea.
Khawaja was starting to feel comfortable at the crease, and this was evident when he moved to 49 with a boundary through fine leg off the bowling of Vernon Philander.
Mitchell Marsh was playing cautiously at the other end, but when Ngidi bowled one just short of a length, he smashed the ball over midwicket for six.
Khawaja finally reached his 11th half-century when he took a single through midwicket off Maharaj, and Australia were slowly chipping away at South Africa’s lead.
The partnership between Khawaja and Marsh was what Australia needed, and they were soon just a handful of runs behind South Africa with an hour left to play.
Proteas captain Faf du Plessis brought Philander back into the attack, and he thought he had trapped Marsh lbw with his first ball, but the umpire – and the third umpire – disagreed.
Rabada made the breakthrough when he ended the 87-run fifth-wicket stand by trapping Khawaja lbw for a well-played 75.
Australia 243 (1st innings): David Warner 63, Cameron Bancroft 38, Kagiso Rabada 5-96, Lungi Ngidi 3-51
South Africa 382 (1st innings): AB de Villiers 126*, Dean Elgar 57, Pat Cummins 3-79, Mitchell Marsh 2-26
Australia 180-5 (2nd innings): Usman Khawaja 75, Mitchell Marsh 39, Kagiso Rabada 3-38, Lungi Ngidi 1-21
Australia lead by 41 runs
Photo: Deryck Foster/BackpagePix