Third Test, Cape Town (day three, close):
Australia 209 & 102-2 v South Africa 651
Coverage: Live on Sky Sports, live scorecard on BBC Sport website
De Villiers' runs came off 196 balls
South Africa's dominance of the third Test against Australia continued as they ended the day 340 runs ahead.
AB de Villiers led the way for the hosts with a bruising 163, including four consecutive sixes off Andrew McDonald shortly after lunch.
Paul Harris made early inroads into the Australian reply, removing Phillip Hughes for 32 with the score on 57.
Ricky Ponting (12) departed soon after, as Simon Katich and Michael Hussey saw out a nervy last hour for tourists.
The Proteas started the day on 404-3 and initially only added slowly to their overnight total as Mitchell Johnson claimed two wickets in the morning session.
Ben Hilfenhaus had the first success of the day, dismissing Jacques Kallis in the third over as the stand-in skipper returned a simple catch to the Tasmanian paceman before he could add to his overnight score of 102.
JP Duminy (7) and Mark Boucher (12) edged angled deliveries from Johnson on to the stumps and into the hands of Ponting at slip before the reply belatedly found some pace to reach 508-6 at lunch.
However De Villiers and debutant Albie Morkel set about the bowling with renewed vigour after the break.
De Villiers admitted that after clearing the boundary four times in successive McDonald deliveries he was tempted to chance his arm on the final two.
"After I had hit the first three, Albie Morkel came down the wicket and said I had to make a decision on whether to go for six sixes," he said.
"I said, 'This is test cricket', but when I hit the fourth one I thought I might give it a shot. But he bowled me a good yorker. I guess it wasn't meant to be."
Morkel passed his half-century off just 59 deliveries before his entertaining stay at the crease came to an emphatic end, clean-bowled by McDonald for 58.
But the medium-pacer continued to be thrashed around the ground by De Villiers before Katich finally ended his colleague's torment with his spin tempting the right-hander into a heave too many.
Debutant Bryce McGain also continued to come in for punishment, having seen his 11 overs cost 102 runs on Friday he saw 47 more come off his seven overs on Saturday.
The final three wickets cost 14 runs as Paul Harris (27) fell to Johnson after Dale Steyn's duck to give the Queensland bowler figures of 4-148 and South Africa their highest-ever total against Australia.
Hughes started brightly and raced to 32 runs as the Australians set about scaling their formidable total.
But after scoring a total of 383 runs in his previous five efforts against South Africa, he could not keep up that form when his side needed it.
An uncharacteristically tentative prod at a wide one from Harris edged the off-spinner to slip.
An uncomfortable Ponting had already earned a television replay reprieve off Steyn, when a loose shot to a delivery three balls later saw him caught behind.
He was shown to be right to stand his ground as Paul Harris claimed a bumped catch at gulley, but was sent walking when Boucher gloved a clear nick.