Bangladesh, replying to South Africa's first innings total of 248, reached 252-5 by lunch on the third day in Chittagong after they resumed play on 179-4.
Dale Steyn had Mushfiqur Rahim leg-before for 28 in South Africa's only success of the morning session, but Shakib and Das then 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.
Das, who was batting on 29 alongside the former Bangladesh captain, drove Steyn straight to take Bangladesh past South Africa's first innings total.
A single off the next ball helped them equal their highest score of 252 runs against South Africa in nine Tests.
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.
The second match of the two-Test series will be played in Dhaka from July 30-August 3.
