Taijul Islam takes 5 wickets
The visitors seemingly marched towards a big total with overnight unbeaten batters Tony de Zorzi and David Bedingham batting with unwavering resolve after resuming at 307-2.
They kept Bangladesh bowlers at bay, playing all kind of shots, specially the sweep shots and reverse sweep against the spinners impeccably.
Taijul then took the onus to help the side hit back, triggering a mini collapse that forced South Africa losing three wickets for just five runs to be reduced to 391-5 from 386-2.
But the first hour of morning session looked completely gloomy for Bangladesh. De Zorzi and Bedingham were unfazed against any kind of plan as the pitch still appeared to be good to bat on.
De Zorzi converted his maiden century to 150 from 235 balls, smashing a tossed-up delivery of Tajiul through mid-wicket for a four.
He appeared to make it double ton but Taijul caused a mental distraction by rattling Bedingham's stump with a quicker delivery to end 116-run partnership.
Bedingham who raised his third fifty off 70 balls, with a single off Mehidy Hasan, was dismissed on 59.
An over later, de Zorzi who was playing sweep shot to precision, missed the line to be trapped leg-before. That ended his marathon 269 ball-177, which included 12 fours and four sixes.
Kyle Verreynne, the centurion of the first Test, also missed a sweep shot to be trapped leg-before for a duck, handing Taijul his 14th five-for.