The Bangladeshis, who progressed to the second phase against the odds after a surprise win over India in the group stage, followed their World Cup record total of 251 for eight by dismissing the South Africans for 184 at the Providence Stadium.
The result seriously damaged strongly fancied South Africa's hopes of reaching the last four from the second stage and gave fresh hope to hosts West Indies and England who had looked to be heading out of the competition.
It was a match which South Africa were expected to cruise to a comfortable two points and move towards to the semi-finals from the round-robin Super Eights.
Instead, Bangladesh, who lost heavily to Australia and New Zealand in the last eight days, completely dominated to win their first points of the Super Eights and could even qualify themselves if they win their remaining games.
Bangladesh's innings was dominated by a flamboyant 87 off 83 balls by 22-year-old number five batsman Mohammed Ashraful, the man of the match.
His innings shone with improvised stroke-play and general unorthodoxy. South African pace bowler Andre Nel claimed a career one-day best 5-45 but that was overshadowed by the youngster's exuberance and flair.
Bangladesh, ranked ninth from 11 in the one-day world rankings, had to recover from 84-4 in the 24th over. They eventually took 80 from their last 10 overs.
South Africa's innings began poorly when Smith (12) missed a cut shot to a straight ball from left-arm seam bowler Syed Rasel.
The match then swung dramatically from 63-1 to 87-6, as key man Jacques Kallis played a mistimed lofted on-drive and was caught off Rasel for 32 and Abdur Razzak bowled A.B. de Villiers (15) seven balls later.
Ashwell Prince was run out, Mark Boucher followed a six over long-off to Saqibul Hasan with a catch to the same region next ball and then Justin Kemp lobbed up a simple return catch to Saqibul a ball later.
As the Bangladeshis scented victory, every wicket was met by excited dance jigs by a team whose average age is 23.
Herschelle Gibbs, who fielded only for a short period because of a calf strain, batted at seven with a runner. He bravely contributed 56 not out.
His stand of 45 with Shaun Pollock was ended by a run out after a sharp pick-up and throw at the stumps by Tamim Iqbal.
Charl Langeveldt made nine before missing a straight delivery from Razzak and the victory was rounded off when Makhaya Ntini holed out from a ballooning thick edge for eight, again off Razzak.
It was Bangladesh's fifth victory in their third World Cup – and probably their best.
South Africa meet tournament hosts West Indies in Grenada on Tuesday and after three defeats already in the Super Eights, the hosts will be doubly determined to make the most of a golden chance to resurrect their campaign.
England, too, have been offered an opportunity to redeem themselves having lost to Sri Lanka this week and failed to bring any points through from the group stage. They were playing Australia in Antigua on Sunday.
Scoreboard
BANGLADESH:
Javed Omar c Smith b Nel 17
Tamim Iqbal c Boucher b Nel 38
Habibul Bashar c and b Nel 5
Saqibul Hasan c Smith b Kallis 9
Mohammad Ashraful c Langeveldt b Nel 87
Aftab Ahmed c Nel b Ntini 35
Mushfiqur Rahim run out 6
Mashrafe Mortaza b Nel 25
Mohammad Rafique not out 3
Abdur Razzak not out 2
EXTRAS (LB-7, W-12, NB-5) 24
TOTAL (for eight wkts, 50 overs) 251
FALL OF WKTS: 1-42 (Javed Omar, 13.4 ov), 2-59 (Habibul Bashar, 17.1 ov), 3-69 (Tamim Iqbal, 19.5 ov), 4-84 (Saqibul Hasan, 23.4 ov), 5-160 (Aftab Ahmed, 37.6 ov), 6-179 (Mushfiqur Rahim, 42.1 ov), 7-233 (Mashrafe Mortaza, 47.2 ov), 8-248 (Mohammad Ashraful, 49.1 ov).
BOWLING: Pollock 10-1-25-0 (2w); Ntini 10-1-61-1 (2w); Nel 10-1-45-5 (3nb, 2w); Langeveldt 10-0-57-0 (2nb); Kallis 6-0-27-1 (3w), Smith 3-0-16-0 (3w); Kemp 1-0-13-0.
SOUTH AFRICA:
G.C. Smith b Rasel 12
A.B. de Villiers b Razzak 15
J.H. Kallis c Tamim b Rasel 32
J.M. Kemp c and b Saqibul 7
A.G. Prince run out 1
M.V. Boucher c Rasel b Saqibul 12
H.H. Gibbs not out 56
S.M. Pollock run out 17
A. Nel c and b Rafique 1
C.K. Langeveldt lbw b Razzak 9
M. Ntini c Mashrafe b Razzak 8
EXTRAS (LB-2, W-12) 14
TOTAL (all out, 48.4 overs) 184
FALL OF WKTS: 1-18 (Smith, 5.4 ov), 2-63 (Kallis, 15.4 ov), 3-64 (de Villiers, 16.5 ov), 4-67 (Prince, 19.5 ov), 5-87 (Boucher, 26.4 ov), 6-87 (Kemp, 26.5 ov), 7-132 (Pollock, 35.5 ov), 8-137 (Nel, 37.3 ov), 9-162 (Langeveldt, 46.1 ov).
BOWLING: Mashrafe Mortaza 9-0-45-0 (1w); Syed Rasel 10-0-41-2 (1w); Abdur Razzak 9.4-1-25-3 (5w); Mohammad Rafique 10-2-22-1; Saqibul Hasan 10-0-49-2.
RESULT: Bangladesh won by 67 runs.
UMPIRES: M.R. Benson (England) and B.R. Doctrove (West Indies).
TV UMPIRE: S.A. Bucknor (West Indies).
MATCH REFEREE: B.C. Broad (England).
MAN-OF-THE-MATCH: Mohammad Ashraful.—Reuters