In their chase, South Africa never looked comfortable against Bangladesh's spin attack and at one stage slumped to 87 for 6 before being all-out for just 184 in their 49th over, with left-arm spinner Abdur Razzak the star taking 3 for 25 off 9.4 overs.
Bangaldesh's win moves them off the bottom of the Super Eight table, and equal on two points with England and the West Indies, while South Africa remain in fourth place with four points from four matches against Super Eight opponents.
"It's a historic win," said Habibul Bashar, Bangladesh captain.
"We can now think of moving forward in the tournament.
"We lifted ourselves in this game and once we put up a good total on the board we knew we could fight."
Opening batsmen Javed Omar and Tamim Iqbal (38) got Bangladesh off to a steady start as they constructed a partnership of 42 runs before Omar was caught by Smith off the bowling of Andre Nel for 17.
This started a top order collapse for Bangladesh as they lost their next three wickets for a further 42 runs to be struggling at 84 for 4, with Nel the destroyer on his way to impressive figures of 5 for 45 from his ten overs.
Ashraful fires up
However Ashraful was joined at the crease by Aftab Ahmed and the pair put on a 76-run partnership for the fifth wicket with Ashraful, who scored a century in Bangladesh's one-day win over Australia in 2005, crafting an entertaining innings of power and guile.
Ahmed added a handy 35 from 43 balls with fast bowler Mashrafe Mortaza also chipping in with a valuable 25 from 16 as Bangaldesh began to frustrate the South Africans in posting a defendable total.
Ashraful was finally dismissed in the last over of his side's innings when he was caught by Charl Langeveldt off Nel on 87.
South Africa collapse
South Africa began slowly and then suffered a collapse of their own from which they never recovered, as they went from a reasonable 63 for 2 to 87 for 6 in the space of ten overs.
Jacques Kallis looked solid as he scored 32 from 36 deliveries, but once he was out caught by Iqbal off the bowling of Syed Rasel, no other South African batsman offered any resistance until an injured Herschelle Gibbs came in at number seven, batting with a runner.
Syed Rasel, right, and Mushfiqur Rahim, left,
celebrate Graeme Smith's wicket [AFP]
Gibbs tried to hold things together with a well-made 56 not-out from 59 balls, but he ran out of partners through a combination of excellent bowling from the Bangladeshis and poor shot selection from the South Africans.
Medium-fast left-armer Rasel made a big contribution to his side's victory, taking 2 for 41 from his ten overs, while fellow opening bowler Mortaza kept things reasonably tight with 0 for 45 from nine.
Left-arm spinner Saqibul Hasan was the other bowler to do some damage as he finished with 2 for 49 from ten overs in a memorable win that Bangladesh can add to the scalp of India in the group stage.
"It's very disappointing," said Smith.
"We let ourselves down and we now need to work very hard from here on.
"We could never build a partnership, but full credit to Bangladesh's bowlers."
South Africa must now regroup as they travel to Grenada to face hosts the West Indies on Tuesday, who will now feel they are in with more of a chance of making the semi-finals, while Bangladesh play England in Barbados on Wednesday.