In what would be a record chase of 331 for a victory, the Proteas ran out of gas losing eight wickets and 21 runs shy at The Oval in England on Sunday.
After the batsmen rose to the occasion in a great show of team spirit to score the record total with only two fifties, the bowlers matched the effort with regular wickets on the back of some smart bowling.
It was a rare off day for Mashrafe Bin Mortaza with the ball, but spinners Shakib Al Hasan and Mehidy Hasan Miraz were magnificent as usual.
Mohammad Saifuddin also turned up after a poor start before strike bowler Mustafizur Rahman proved too much for the South Africans to handle.
The chief architect of the victory, Shakib took one vital wicket after hitting a half-century to become the Player of the Match and fastest cricketer to join the elite club of all-rounders with 5,000 runs and 250 wickets in 199 matches.
Bangladesh made their intention clear right from the word go when South Africa skipper Faf du Plessis put them in to bat. He was hoping to bounce them out cheaply with his pace attack on a wicket used in the previous match which they had lost to hosts England.
Bangladesh responded with a steady start with Soumya Sarkar hitting Lungi Ngidi for two back-to-back boundaries with immaculate pull shots.
Tamim Iqbal, injured during practice, shook off the early jitters with two magnificent fours, taking his team to 58 in eight overs.
However, he was the first to fall after a promising 29-ball 16 with the score at 60, giving Andile Phehlukwayo a wicket in his first over.
Soumya followed shortly afterwards, edging a Chris Morris behind to Quinton de Kock after striking nine exquisite boundaries in his innings of 42 off 30 balls.
But the two quick wickets failed to dampen the Tigers' charge. Shakib and Mushfiqur combined to put up a 75-run unbeaten stand for the third wicket to take Bangladesh to 150 in 24 overs. They breezed past the 100-run mark in 16 overs on the heels of Soumya’s blistering knock.
A 142-run stand between Shakib and Mushfiqur, highest partnership for Bangladesh in World Cup, laid the foundation for the big score.
Shakib made 75 off 84 balls, including eight fours and a six, to fire the Tigers past 200. He was subsequently bowled by Imran Tahir in the 36th over with the score at 217.
Mushfiqur also brought up his fifty during the huge third-wicket partnership, and went on to score a run-a-ball 74.
It was the fourth fifty by Shakib in as many opening matches of Bangladesh in World Cup. Mushfiqur’s was his third in World Cup openers.
Between Shakib and Mushfiqur, Tahir picked up his second wicket when he bowled Mohammed Mithun for 21 to leave the Tigers 242 for 4 in the 40th over.
Mithun's dismissal slowed Bangladesh down as they made only 32 off six overs. But Mahmudullah and Mosaddek Hossain made up for the sluggish run rate with a partnership of 41-ball 66.
Mosaddek made 26 off 20 while Mahmudullah scored a whirlwind 46 off 33 as the Tigers racked up 54 in the final four overs.
South Africa could not get the full 10 overs from their strike bowler Lungi Ngidi as he left with a hamstring injury after giving away 34 runs in the four overs he bowled.
South Africa looked to Quinton de Kock to give them a blistering start in the chase, but Mustafizur and Miraz did not let them him run amok.
The opening stand of 49 broke when Mushfiqur dropped de Cock at 23 but made amends by hitting the stumps as the batsman tried to use the chance to steal a run.
Hashim Amla was rested after he sustained head injury in their previous match, but Aiden Markram partnered with du Plessis to keep South Africa on track until Shakib struck.
The left-arm spinner bowled Markram for 45, using the angle.
South Africa continued to build partnerships with all their middle-order batsmen scoring runs, but Bangladesh bowlers did not let any of them go on to make a big hundred as they took wickets at regular intervals.
Miraz lured dangerman Du Plessis (62 off 53) down the track, and spun one through the gate.
He then caught David Miller off a Mustafizur delivery after the South African scored 38 off 43.
Rassie van der Dussen (41 off 38) briefly threatened before Saifuddin took him out.
JP Duminy was the last hope for South Africa. Mustafizur halted him when he was on 45 after taking the wicket of Morris (10) and almost sealed the victory.
The Bangladesh fans, who occupied most parts of the gallery with a capacity of 24,000, burst into celebrations when the last ball was bowled.
BRIEF SCORES: Bangladesh 330 for 6 in 50 overs (Mushfiqur Rahim 78, Shakib Al Hasan 75; Andile Phehlukwayo 2-52, Chris Morris 2-73, Imran Tahir 2-57) beat South Africa 309 for 8 in 50 overs (Faf du Plessis 62; Mustafizur Rahman 3-67) by 21 runs.