Port Elizabeth: South Africa was content with slow, grinding progress to post 423 and Vernon Philander and Wayne Parnell picked up two wickets each to leave Australia in a lot of trouble. The visitors were 112 for 4 in the post tea session on day 2, trailing by 311 runs.
Vernon Philander struck early in the Australian innings when he trapped Chris Rogers leg before wicket for five - the third successive single figure score by the left-handed opener.
Fellow opener David Warner counter-attacked but Parnell plunged Australia into trouble. Playing on his home ground in his first Test match in four years, he had Alex Doolan and Shaun Marsh caught behind with his first and third deliveries.
Warner was dropped on 43 when Morne Morkel got a ball to lift sharply and Warner edged it high to De Villiers' left. But South Africa struck again when Philander returned for his second spell and had Australian captain Michael Clarke caught at cover for 19.
Warner finished the day with 65 not out off 67 balls and nightwatchman Nathan Lyon was 12 not out. But South Africa failed to ask for a review when Lyon edged the ball down the legside off Dale Steyn in the penultimate over and he was dropped at gully by Duminy off Parnell in the last over of the day.
On a pitch that offered nothing for the Aussie quicks, and only a little for the spinners, AB de Villiers and JP Duminy made centuries at St. George's Park to back up first-day half-centuries by Dean Elgar and Faf du Plessis.
South Africa was bowled out straight after tea on the second day as offpsinner Nathan Lyon took 5-130.
De Villiers' 116 was his sixth century and 12th score over 50 in his last 12 matches. Duminy top-scored with 123 and reached three figures in the second session with a powerful sweep that raced to the square leg fence as South Africa built a solid first-innings score after picking seven specialist batsmen and jumping at the chance to bat first in a crucial game for its chances of fighting back in the series.
De Villiers and Duminy combined for 149 for the sixth wicket after South Africa was 214-5 overnight. Australia's spinners were the only wicket-takers in the two-and-a-bit sessions the tourists bowled on Friday on the unresponsive pitch, with off-break bowler Lyon leading with his five-for and removing De Villiers and Duminy.
Lyon caught De Villiers off his own bowling and had Duminy lbw trying a reverse sweep straight after tea to limit the damage to an extent. Australia's spinner bowled 46 of the 150.5 overs in the innings.
Morne Morkel was run out for the last wicket.
Captain Michael Clarke also picked up Vernon Philander for 6, caught and bowled with his part-time offspin, but left-arm quick Mitchell Johnson and the pacemen didn't taken a wicket in around 145 overs, an indication that the pitch heavily favors the batsmen.
Still, South Africa had to fight to get out of the trouble it found itself at the end of the first day at 214-5, with De Villiers again leading his team to safety with his golden run of form. He's made six centuries and six half-centuries in 18 innings over 12 Tests dating to November 2012, taking him to the top of the Test batting rankings.
Clarke tried seven bowlers, including himself, legspinner Steve Smith and part-time seamer David Warner along with the front-line attack, and also threw up some inventive fields to try and force a mistake from the batsmen. At one point, he had four fielders in catching positions in the midwicket region to De Villiers, who merely clipped the ball over their heads for a six to go along with his 14 fours.
Even with the heavy cloud cover throughout most of the first two days, there has been precious little swing or seam since Johnson removed Hashim Amla lbw in the sixth over of the match to have South Africa 11-2.
Brief scores
South Africa 423 (Duminy 123, de Villiers 116, Lyon 5-130)
Australia 112 for 4 (Warner 65*)
Status Australia trail by 311 runs