Bangladesh chased down 308 to win the third one-day international against New Zealand and sweep the series 3-0 in Fatullah.
Black Caps skipper Ross Taylor built on solid foundations to register his eighth one-day hundred as the tourists piled on 307-5 in their 50 overs, Colin Munro adding 85.
But the hosts got off to a flying start and Shamsur Rahman led the chase with 96 from 107 balls, although he was out with more than 100 still required.
Naeem Islam added 63 before Nasir Hossain saw them safely home in the final over with an unbeaten 44 off only 38 balls.
Rahman, playing in just his second ODI, was soon in on the act plundering 10 from the following over including a six - something his opening partner repeated soon after.
The 50 partnership came up in the seventh over but Ziaur Rahman (22) was gone soon after as he was caught by Adam Milne off the bowling of Mitchell McClenaghan.
That brought Mominul Haque to the crease and, while the run-rate slowed a little, Haque took just 33 balls to make his 32 before being caught and bowled by Anton Devcich.
The hosts were cruising at 126-2 at that point but Mushfiqur Rahim added just two before he was caught by Taylor off a Nathan McCullum delivery.
Shamsur and Naeem then put on 75 to steady the ship before the former fell just four runs short of his century as he threw his hands at a Corey Anderson delivery and it carried to Luke Ronchi behind the stumps.
Naeem (62) soon brought up his half-century as he built a 50 stand with Nasir, but the former was run out in the 43rd over and Bangladesh required 49 runs off the last seven overs.
Mahmudullah added 16 before he was caught behind off McClenaghan, but a Hossain six left the home side needing a run a ball off the last two overs and they got home with four balls to spare.
Earlier, Taylor and Colin Munro had done the damage as the Black Caps looked to salvage some pride having already surrendered the series.
Devcich and fellow opener Tom Latham brought up a 50 opening partnership in less than eight overs but the former fell four short of a half-century when he top-edged a sweep at Mahmudullah and was caught by Abdur Razzak to end a stand of 66.
Latham punished Mushfiqur for a missed stumping off Razzak by hitting the spinner for six, although Grant Elliott holed out two balls later for three.
Latham followed for 43, made from 73 balls with two sixes but no fours, when he edged Rubel Hossain to Mushfiqur.
Taylor had contributed just 11 when Rubel dropped him off his own bowling and he and Munro brought up their 50 stand in 10.3 overs the ball after Munro reverse-pulled Razzak for six.
Back-to-back boundaries took Taylor into the 40s and he followed his partner to 50 moments before Munro (85) gloved Mahmudullah to Mushfiqur, again attempting a reverse hit.
Anderson scored just one but Taylor hit two fours off Razzak, a mere prelude to three consecutive sixes off Sohag Gazi as he powered his side towards a big total.
He added three fours in a Mashrafe Mortaza over and reached his hundred with two balls remaining as the Kiwis hit 98 off the last 10 overs.
Taylor's first 50 runs came off 69 balls with two boundaries but, after Munro's departure, he added 57 from a further 24 - with seven more fours and those three maximums - but the challenging total proved just insufficient.