Bangladesh took a first innings lead of 78 runs before they were all out for 326 runs during the extended second session of the third day's play in Chittagong.
South Africa, who made 248 in the first innings, were 23-0 in their second knock at tea with Stiaan van Zyl on 13 and Dean Elgar on 10. The tourists still trail by 55 runs.
Fast bowler Dale Steyn finished with 3-78 to become only the second South African bowler after former captain Shaun Pollock to take 400 Test wickets.
Das made 50 off 102 balls with the help of seven boundaries and tail-ender Mohammad Shahid belted 25 off 19 balls to provide Bangladesh the edge.
Also Read
Steyn had Mushfiqur Rahim leg-before for 28 in South Africa's only success of the morning session, but Shakib (47) and Das stood firm to defy the visiting bowlers.
Rahim, who was initially given not out before South Africa successfully reviewed the decision, added 12 runs to his overnight score.
Bangladesh, who have lost their previous eight Tests against South Africa, most of them by an innings margin, had made an impressive start to the match by bowling out the Proteas cheaply on the opening day.
Mohammad Mahmudullah scored 67 and Tamim Iqbal added 57 in the rain-shortened second day to lay a strong foundation for the home side.
The second match of the two-Test series will be played in Dhaka from July 30-August 3.