Having won the first match at the same venue two days ago, the hosts were asked to bat first in what was expected to be another low-scoring match, having dismissed the tourists for less than 200 in the opening game.
Anamul Haque had scored 41 on debut in that game as half-centuries from Tamim Iqbal and Naeem Islam saw Bangladesh home, but in this game some fine late scoring helped push the Bangladesh total closer to 300.
Tamim and Naeem both went for single figures though, as Andre Russell and Ravi Rampaul made early inroads into the home batting. But from 21 for two Bangladesh staged a recovery which owed everything to Anamul Haque and Mushfiqur Rahim.
When the latter fell for 79, the second of Rampaul's victims when caught by Lendl Simmons, the hosts had reached 195 for three.
Nasar Hossain also went cheaply and his dismissal brought Mominul Haque to the crease and together with his namesake he put on 64 for the fifth wicket.
Mominul Haque became Rampaul's fourth wicket when he was dismissed for 31 off 29 balls, leaving the home side on 265 for five with 10 balls remaining.
Anamul Haque became victim number five off the next ball when he finally perished for 120. His runs had come off 145 balls and included two sixes and 13 fours.
Mashrafe Mortaza survived the hat-trick ball by taking four off Rampaul and also claimed six off successive Marlon Samuels balls in the final over.
Mortaza clubbed 18 off six balls faced as he and Mahmudullah (3) pushed Bangladesh to 292 for six as some late hitting helped the home side set an challenging total.