It was their first win in the format against the Black Caps in New Zealand.
The Black Caps made a horror start, collapsing to 20 for four. But Jimmy Neesham tonked 48 from 29 deliveries to help drag the home team through to 134 for nine.
Shoriful Islam (three for 26), Mahedi Hassan (two for 14) and Mustafizur Rahmanm (two for 15) made the biggest dents with the ball.
It was a disciplined bowling display by the visitors on a wicket Neesham described as a "little naughty".
Bangladesh opener Litton Das anchored the chase with a gutsy undefeated 41.
He had some late luck. Ish Sodhi stepped on the rope while making a catch in the 18th over.
Das was hobbling at the end, having injured himself.
The wickets column outpaced the runs tally early on.
Spinner Hasan slipped an off-break past Tim Seifert in the opening over and bowled him for a duck.
Finn Allen wafted at a length delivery from Islam which nipped away and collected the edge.
And Glenn Phillips shouldered arms first ball and was trapped in front.
Mark Chapman survived the hat-trick ball from Islam, but the home team was one for three.
Daryl Mitchell provided some relief with consecutive boundaries. But he was bowled for 14 and New Zealand slipped further.
The Black Caps needed a partnership and the lefties Chapman and Neesham provided some starch.
Hasan shuffled through the last of his four overs. He had a fine night.
With Hasan out of the way the Black Caps looked to attack Rishad Hossain. Chapman climbed into a big shot but sliced a catch to deep cover.
Neesham and Mitchell Santner teamed up to take 15 runs off the 14th over and puffed some air back into the tyres.
Islam broke the partnership, but it took a couple of million replays to decide whether Soumya Sarkar got his hands under the ball before it bounced.
The end result was Santner was gone for 23.
Bangladesh went too hard at the chase early and lost a couple of wickets inside the powerplay.
The captain Najmul Hossain Shanto blasted 19 before he baseballed a delivery straight to Santner at mid-off.
Soumya Sarkar continued his strong form, rattling on 22 before he got too ambitious and was bowled by Ben Sears.
Sarkar would want that shot back again. It was perhaps best described as a hoick.
Bangladesh was cruising towards victory, though. But Tim Southee removed Afif Hossain with a well-directed bumper and that left the lower order exposed.
NEW ZEALAND
F Allen c Sarkar b Islam 1
T Seifert b Hasan 0
D Mitchell b Hasan 14
G Phillips lbw Islam 0
M Chapman c Hasan Sakib b Rishad Hossain 19
J Neesham c Afif Hossain b Rahman 48
M Santner c Sarkar b Islam 23
A Milne not out 16
T Southee c Afif Hossain b Rahman 8
I Sodhi c Das b Hasan Sakib 2
B Sears not out 1
Extras (1lb, 1w) 2
Total (9 wkts, 20 overs) 134
Fall: 1-1, 2-1, 3-1, 4-20, 5-50, 6-91, 7-110, 8-124, 9-127.
Bowling: Mahedi Hasan 4-0-14-2, Shoriful Islam 4-0-26-3, Tanzim Hasan Sakib 4-0-45-1 (1w), Mustafizur Rahman 4-0-15-2, Rishad Hossain 3-0-24-1, Afif Hossain 1-0-9-0.
BANGLADESH
Litton Das not out 41
Rony Talukdar c Southee b Milne 10
Najmul Hossain Shanto c Santner b Neesham 19
Soumya Sarkar b Sears 22
Tawhid Hridoy c Southee b Santner 19
Afif Hossain c Neesham b Southee 1
Mahedi Hasan not out 19
Extras (3lb, 2w) 5
Total (for 5wkts, 18.3 overs) 137
Fall: 1-13, 2-38, 3-67, 4-96, 5-97
Bowling: T Southee 4-0-16-1, A Milne 3.4-0-39-1 (1w), J Neesham 1-0-7-1, B Sears 4-0-36-1, I Sodhi 2-0-20-0 (1w), M Santner 4-0-16-1
Result: Win to Bangladesh by 5 wickets