Mominul Haque and Mahmudullah hit half-centuries to enable Bangladesh to avoid the follow-on but their total of 320 was still 176 short of South Africa's first innings total of 496 for three declared.
In contrast to the first day, Bangladesh dismissed both South African opening batsmen cheaply at the start of the second innings.
South Africa were 54 for two when bad light ended play early, an overall lead of 230. Dean Elgar and Aiden Markram were out for 18 and 15 respectively, after making 199 and 97 in the first innings.
On a slow pitch, Bangladesh had four successive half- century partnerships between the third and sixth wickets.
The tourists batted with positive intent, although much of the good work was undone when they lost their last five wickets for 28 runs, four of them after the second new ball had been taken.
The diminutive Mominul and fellow left-hander Tamim Iqbal saw off some hostile bowling by Morne Morkel and Kagiso Rabada at the start of the day, with the first nine overs producing only seven runs.
The only wicket of the morning fell to new cap Andile Phehlukwayo when Tamim, on 39, glanced an off-target delivery down the leg side and wicketkeeper Quinton de Kock flung himself to his right to take a good catch.
Mominul was well caught at short leg by Markram off left-arm spinner Keshav Maharaj soon after lunch after a 150- ball innings which included 12 fours.
Rahman played a lifting ball from Duanne Olivier onto his stumps and Mahmudullah fell to the first delivery with the second new ball when an attempted cut against Morkel crashed into his stumps off an inside edge. Mahmudullah faced 124 balls and hit 11 fours and a six.
Maharaj was the most successful South African bowler, taking three for 92.
Disclaimer: No Business Standard Journalist was involved in creation of this content
