Australia's Usman Khawaja plays a shot. Photograph:( Reuters )
Usman Khawaja scored 75 runs to lead an Australia fightback on the third day of the second test against South Africa at St George's Park, but succumbed just before close of play after seeing the tourists cancel out a first innings deficit.
Australia will take a 41-run led into the fourth day after finishing Sunday's play at 180 for five wickets.
Khawaja and Mitchell Marsh put together a 87-run partnership for the fifth wicket before Khawaja, whose place in the team has been under threat because of a lack of form, was trapped leg before wicket by Kagiso Rabada in the second last over of the day.
It was a blow to the tourists who had been showing strong resistance after teetering at 86-4 just after tea.
Marsh played a solid supporting role to be 39 not out at the end of the day. He will resume on Monday with Tim Paine, who has five runs to his name.
Australia lost three wickets in the second session after lunch, including that of captain Steve Smith, and then Shaun Marsh with the second ball of the last session before Khawaja dashed home hopes of rattling through the Australian batting line-up.
Smith, ranked the world's top test batsmen, went cheaply as he was caught behind for 11 after he got a slight edge to the spin bowling of Keshav Maharaj while David Warner, also key to their hopes, was bowled by Kagiso Rabada for 13.
South Africa had a first innings lead of 139 after being bowled out for 382 just before lunch.
AB de Villiers notched up his 22nd test century in scoring an unbeaten 126 in a busy morning session to help South Africa into a good lead.
He had not scored a ton in his last 13 tests but featured in an 84-run partnership with Vernon Philander (36) for the eighth wicket and further 58 with Keshav Maharaj, who swatted at the Australian bowling to score 30 off 24 balls.
Australia lead 1-0 in the four-test series.