Bangladesh were 127 for three at the close, still trailing by 369 runs after South Africa declared their first innings on 496 for three.
Dean Elgar made 199 and Hashim Amla scored 137 as South Africa batted remorselessly until tea before captain Faf du Plessis declared.
The declaration caused a problem for Bangladesh because regular opener Tamim Iqbal had been off the field towards the end of South Africa's innings, which meant he had to wait for 48 minutes before he could bat.
It was the first time in his 52-Test career that he had not faced the first ball of an innings.
More From This Section
Kagiso Rabada made an early breakthrough for South Africa when Imrul Kayes gloved a catch to gully in the sixth over.
Morne Morkel followed up with the wicket of emergency opener Liton Das, who made a spirited 25, including two successive pulls for four off Morkel, before edging the tall fast bowler to first slip.
Bangladesh captain Mushfiqur Rahim made an aggressive 44 off 57 balls but was fortunate to survive two sharp chances to Elgar at slip off left-arm spinner Keshav Maharaj when he was on six and 15. He eventually fell to Maharaj, caught off bat and pad at short leg.
Opening batsman Elgar and Amla put on 215 for the second wicket as South Africa again gave Bangladesh cause to regret their decision to send the hosts in to bat.
Amla became the first batsman to fall to a bowler when he slashed a wide ball from Mustafizur Rahman to backward point in the first over after lunch.
Amla went to his 27th Test century in fluent style. He joined former captain Graeme Smith as the country's second- highest century-maker, behind only Jacques Kallis, who made 45. Amla scored his runs off 200 balls with 17 fours and a six.