The hosts require an unlikely 271 runs to make South Africa bat again and avoid an innings defeat, after the tourists won the first Test in Dhaka by five wickets.
Mushfiqur Rahim on four and Abdur Razzaq on zero were the not out batsmen for Bangladesh at the close of play.
Dale Steyn, South African fast bowler, provided the vital breakthroughs, picking up three of the five wickets to fall in the second innings while left-arm spinner Robin Peterson took the other two.
Steyn accounted for opener Junaid Siddique (0), captain Mohammad Ashraful (4) and Shakib Al Hasan (2) for figures of 3 for 4 from 4.3 overs.
"It hurts to follow on and bat twice in the same day."
Peterson dismissed Shahriar Nafees for a 55-ball 31 containing five fours and a six, and his opening partner Tamim Iqbal for nine.
Nafees had earlier top-scored for the hosts in the first innings with 69 which included 12 fours.
"It hurts to follow on and bat twice in the same day. But all credit to their bowlers, who bowled well throughout the day," Nafees said.
"Steyn was unplayable on a few occasions but we are not scared of short-pitched stuff. The ball was not going over our heads because the wicket is flat."
Hosts struck by Ahmed blow
The only other notable contributor to the first-innings total was Shakib, who chipped in with 40 as the South African fast bowlers proved too good for the fragile Bangladesh batting line-up.
Makhaya Ntini, South Africa paceman, was also among wickets with 4 for 35, polishing off the tail in quick time after Steyn's 4 for 66 had done the early damage.
Ntini finished the Bangladeshi first innings when he got rid of tailenders Mohammad Rafique and Mashrafe Mortaza soon after the tea break on day three.
Batsman Aftab Ahmed had to retire hurt on 21, adding injury to insult for Bangladesh.
Ahmed missed a hook off Jacques Kallis, with the ball going through his helmet grille and hitting him on the cheekbone. The right-hander needed three stitches for the cut after being stretchered off the field in great pain.
It was not clear whether Ahmed would bat in the second innings as he was being kept under medical observation for 24 hours.
Bangladesh had enjoyed a fine morning session when they put on 108 runs for the loss of one wicket, that of nightwatchman Abdur Razzaq for 33, but Steyn started the demise in the second session when he dismissed Nafees, who had hit him for two fours earlier in the over.