Published: 2017-10-01 16:39:26 BdST
Morne Morkel snagged two wickets in the first over of Bangladesh's second innings and they were 49 for three at stumps, still 375 runs shy of an improbable victory.
South Africa, who had started the day 54-2, declared their second innings on 247 for six, with captain Faf du Plessis scoring 81 and Temba Bavuma 71.
A partnership of 142 between the pair pushed along the scoring rate as South Africa sought to set Bangladesh a large target, but still give themselves enough time to bowl them out on a pitch that has proven lifeless.
Two breaks for rain hastened the decision to declare and when Morkel bowled Tamim Iqbal with the fourth ball of the opening over and then had Mominul Haque trapped leg before two balls later, it seemed all was going to plan for the home team.
Mominul had consulted with Imrul Kayes about reviewing the decision to give him out but was persuaded not do so, only for television replays to show Morkel's delivery was headed well down off and that the umpire had made a poor decision.
Morkel then removed the middle stump of Mustafizur Rahman with the second ball of his next over only for TV to show he had bowled a no-ball, reinstating the batsman.
It means Morkel now holds the world record of 14 Test dismissals being overturned because his foot was over the bowling crease. To add to the ignominy, he was later taken to hospital with a side strain that could rule him out of the rest of the series.
Imrul was the third wicket to fall as he was caught behind off the spin bowling of Keshav Maharaj for 32. Captain Mustafizur, not out on 16, and Liton Das will resume on the last day with survival uppermost on the visitors' agenda.