That gave the home side a lead of 139 on the first innings and by the close on day three, the Australians had erased the deficit and reached 180 for five. While all his other team-mates struggled to score at a good clip, de Villiers collected runs easily, managing a strike rate of 86.30 while the rest of South Africa's top eight combined to score at 38.22.
Australia lead the four-test series 1-0.
Replays confirmed that wasn't the case, but they also revealed how de Villiers went close to losing his balance and dislodging the bails.
"It was vital for us to get a reward after toiling [in the last session] for that long", he said.
De Villiers' innings was in complete contrast to the struggles of his teammates against superb reverse swing bowling.
Rabada was responsible, bowling a brilliant delivery that nipped back just enough to hit Warner's off stump, before he celebrated by screaming in the opener's face.
He hit 20 fours and a six in his century, going to 100 with a boundary down to third man.
Smith was out edging to Maharaj for the second time in the series, a dismissal sure to result in more questions about his poor record against left-arm spinners.More news: Kareena Kapoor Khan, Karisma Kapoor Meet Hillary Clinton - See Pic
More news: South African bowler Rabada charged after Smith incident
More news: This Is Why Sridevi's Sister Srilatha Remained Quiet On The Actress' Death
The South Africa captain Faf du Plessis wasted both reviews during the final session.
Khawaja and Mitch Marsh dug deep, though, producing a near chanceless stand of 87 runs as the former mixed his trademark elegance with resolute and compact defence. Rabada delivered the breakthrough, trapping Khawaja lbw with a ball that dipped late. The first hour is crucial in terms of who may win this Test.
Somehow, the South Africans finished the day on 7-263. Bancroft scored 24 before he chopped a Lungi Ngidi delivery onto his wicket.
Philander added 22 to his overnight tally before being caught at short leg by Bancroft off Pat Cummins for 36.
Move to the third day, he continued superbly alongside Vernon Philander and brought about his 22nd Test century and remained unbeaten when the last wicket fell. "Today was a tough day of Test cricket and I think those people who are Test match lovers will appreciate the skill of the bowlers and at times, especially when AB was batting, the skill of the batting", he said.
The partnership for the ninth wicket yielded a further 58 runs to the frustration of the tourists.
Rabada, recently ranked the No. 1 bowler in test cricket, has also previously been disciplined three times for his actions after dismissing batsmen and served a one-test ban in England previous year.
Rabada has demerit points hanging over him and could miss the rest of the series if found guilty. He returned for the Boxing Day Test against Zimbabwe and has been part of all five Tests against India and Australia since then.