Playing only his third test, Temba Bavuma topscored for them with a gritty 54 before becoming the last Protea batsman to fall.
Left-arm bowler Rahman, who had claimed 5-50 in his ODI debut against India, claimed 4-37 as he and leg-spinner Jubair Hossain (3-53) tormented the top ranked test team.
The hosts, on a high after stunning South Africa in the preceding one-day series, were seven for no loss at stumps after Tamim Iqbal (1) and Imrul Kayes (5) saw through the final two overs of the day.
Earlier, Stiaan Van Zyl (34) hit Mohammad Shahid for two boundaries in the first over to signal his positive intent but fell to an innocuous Mahmudullah delivery that was sliding down the leg.
Dean Elgar (47) and Faf Du Plessis (48) built on the 58-run opening stand to take South Africa past the 100-mark, regularly finding boundaries and rarely looking in discomfort in their 82-run partnership.
South Africa lost two wickets in three balls and were suddenly struggling to score against a team eight places below them in the test rankings.
Elgar nicked a Taijul Islam delivery behind and Du Plessis was trapped leg-before by a Shakib Al Hasan delivery that kept low.
Rahman then mowed down the middle order in the 60th over, dismissing rival skipper Hashim Amla for his first test wicket.
His next delivery trapped the scoreless JP Duminy LBW, after the hosts successfully reviewed the original not-out decision and got it overturned.
Quinton de Kock managed to deny Rahman a hat-trick but lost his off-stump in the very next delivery.
Hossain dismissed Simon Harmer and Dale Steyn in the same over before Rahman ended Bavuma's resistance to restrict South Africa under the 250-mark.
(This story has been refiled to change day to Tuesday in intro)
(Reporting by Amlan Chakraborty in New Delhi; Editing by John O'Brien and Robin Pomeroy)
Share
