Chittagong - Shakib Al Hasan and Litton Das added 57 runs in an unbroken sixth wicket partnership as Bangladesh gained a first innings lead over South Africa in the first Test Thursday.
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.
Shakib, unbeaten on 32 at the break, started slowly but found his rhythm after hitting medium pacer Stiaan van Zyl for two back-to-back fours.
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.
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.