De Villiers had made 46 when he pulled at a ball from captain Mohammad Ashraful which had bounced twice before reaching his bat.
Ashraful took the return catch while de Villiers stood his ground believing that the ball was dead.
But umpire Steve Bucknor raised his finger, rightly so since the rules state that a ball will be deemed legitimate if it does not bounce more than twice before hitting the bat.
It was an important breakthrough for the hosts as de Villiers was growing in confidence, having hit seven fours and a mighty six over the mid-wicket in his 73-ball knock.
De Villiers said he was aware of the law but was just wondering if the delivery would be declared a no ball.
"I was aware of the rule but I was hoping for someone to call it a no-ball or whatever. It is the first time in my career that I have been dismissed in such a fashion."
It was also a crucial decision by Bucknor who was standing in his first Test since being controversially axed from the volatile Australia-India series earlier this year.
South Africa were 145-5 at the time in reply to the home side's 192. The tourists were eventually bowled out for 170 before Bangladesh build up a 147 lead after reaching 125-4 in their second knock.