AB de Villiers stroked an unbeaten 126 as South Africa took a 139-run first innings lead by reaching 382 all out in a busy morning session against Australia.
De Villiers, who had not scored a ton in his last 13 tests, featured in an 84-run partnership with Vernon Philander for the eighth wicket as the pair saw off any potential impact of the new ball from an Australian attack that looked tired after their exertions on Saturday.
Philander added 22 to his overnight tally before being caught at short leg by Bancroft off Pat Cummins for 36.
De Villiers reached his century soon after with an audacious shot over the slips as he was joined by Maharaj, who swatted at the Australian bowling to score 30 off 24 balls before he was bowled by Josh Hazlewood.
The partnership for the ninth wicket yielded a further 58 runs to the frustration of the tourists.
Australia scored 243 in their first innings.
The tourists lead 1-0 in the four-test series.