Teenage fast bowler Mustafizur Rahman and off-spinner Nasir Hossain picked up three wickets each as the tourists were all out in 46 overs after winning the toss and opting to bat first on a sluggish pitch at Mirpur.
Bangladesh lost two early wickets to Kagiso Rabada in their chase but opener Soumya Sarkar (88 not out) and Mahmudullah (50) added 135 for the third to ensure the hosts continued their fine form in the 50-over version of the game at home.
Bangladesh blanked Pakistan and then defeated twice world champions India in their last two ODI series and Sunday's victory was only their second in the format against South Africa, who won the first match of the series by eight wickets.
The hosts romped to the target with more than 22 overs to spare and the win also sealed their spot amongst the top eight-ranked nations for next year's Champions Trophy in England.
Rabada, who took six wickets on debut in the last match, gave South Africa some hope by dismissing Tamim Iqbal in his first over and Litton Das in his second but it was not enough.
Mahmudullah fell with Bangladesh four runs from victory and Sarkar took them over the line with a six off leg-spinner Imran Tahir. Left-handed Sarkar also hit 13 fours during his 79-ball unbeaten knock.
Earlier, the South African batsmen failed to find any momentum against the disciplined Bangladesh attack and managed to cross the 100-run mark only in the 32nd over.
Mustafizur, who won the man of the series award against India with 13 wickets from three matches, struck the first blow by dismissing Quinton de Kock in the fifth over as South Africa kept losing wickets at regular intervals.
Faf du Plessis was the highest scorer for South Africa with 41 while Farhaan Behardien's 36 ensured the team crossed the 150-run mark.
Chittagong will host the third and final ODI of the series on Wednesday.
Scorecard
South Africa:
H Amla b Rubel 22
Q de Kock c Sabbir b Mustafizur 2
F du Plessis c Sarkar b Nasir 41
R Rossouw b Nasir 4
D Miller c Mortaza b Mahmudullah 9
J Duminy c Sabbir b Mustafizur 13
F Behardien c Nasir b Mortaza 36
C Morris lbw b Rubel 12
K Rabada b Mustafizur 10
K Abbott lbw b Nasir 5
I Tahir not out 1
Extras (lb 4, w3) 7
Total (all out; 46 overs) 162
Fall of wickets: 1-16, 2-45, 3-59, 4-74, 5-93, 6-100, 7-116, 8-138, 9-160, 10-162
Bowling: Mustafizur 10-1-38-3 Mortaza 5-0-17-1, Shakib 10-0-30-0, Rubel 9-2-34-2, Nasir 8-0-26-3, Mahmudullah 4-0-13-1.
Bangladesh
T Iqbal b Rabada 5
S Sarkar not out 88
L Das b Rabada 17
Mahmudullah c Amla b Abbott 50
S Hasan not out 0
Extras (w-5, nb-2) 7
Total (for 3 wickets; 27.4 overs) 167
Fall of wickets: 1-5, 2-24, 3-159
Bowling: Abbott 5-0-22-1, Rabada 7-0-45-2 (nb1, w5), Morris 3-0-29-0 (nb1), Imran 8.4-1-40-0, Duminy 2-0-20-0, Behardien 2-0-11-0.
Image: Soumya Sarkar
Photograph: Quinn Rooney/Getty Images
South Africa's Rabada claims hat-trick on debut against Bangladesh
End of an era as Casillas leaves Real Madrid
Bangladesh, Pakistan have eye on ICC Champions Trophy 2017
Having Dhoni up the order gives me confidence: Dhawan
Hail Bangladesh's bowling sensation Mustafizur... the new MVP!