Temba Bavuma made 93 and the tailenders added valuable runs to help South Africa post 367 all out in its first innings in the opening test against Bangladesh on Friday.
Bangladesh was 52-1 after 16 overs as Shadman Islam was bowled by spinner Simon Harmer for 9 at tea on Day 2.
Bavuma completed his 18th test half-century on the first day but has still only got one test hundred to his name, back in 2016. He fell seven runs short this time when he was bowled by spinner Mehidy Hasan Miraz (3-94).
Bavuma's innings still helped push South Africa to a solid first-innings total after being put in to bat by Bangladesh at Kingsmead in Durban. South Africa was 233-4 overnight and lost four wickets in the first session of the second day.
Bavuma built a half-century partnership with Kyle Verreynne (28) on Day 1 and another with Keshav Maharaj (19) on Day 2.
Verreynne and Wiaan Mulder fell off successive balls to pace bowler Khaled Ahmed, who had figures of 4-92 to lead Bangladesh's bowling effort. Bavuma and Maharaj also were dismissed in the space of two balls.
But Harmer, who is playing his first test since 2015, made 38 not out and was the anchor as South Africa's last two wickets put on 69 runs. He hit four fours and a six.