Sri Lanka, the world's top-ranked Twenty20 side, made 168-7 after being sent in to bat and then restricted Bangladesh to 166-7 to take the lead in the two-match series. (Agencies)
With Bangladesh needing 17 runs from the final over, Anamul smashed 14 runs off the first five deliveries, but then gave Perera a return catch with the last ball.
Anamul returned disappointed after making a gallant 58 off 45 balls with seven boundaries, including three in the tense final over.
Tamim Iqbal and Shamsur Rahman gave the hosts a flying start with an opening stand of 52 in six overs, before both batsmen fell in the space of two overs to make it 64-2.
Shakib Al Hasan helped Anamul add 43 for the third wicket, but Bangladesh lost four quick wickets to slip from 107-2 in the 14th over to 158-6.
Anamul faltered when it mattered most to leave Sri Lanka victors as Thisara Perera and Nuwan Kulasekara finished with two wickets each.
For Sri Lanka, left-handed opener Kusal Perera top-scored with 64 off 44 balls, but he found little support from the rest of the top order batsmen.
Sri Lanka were reduced to 120-6 in the 15th over, before Kulasekara and Thisara Perera boosted the total with a seventh-wicket partnership of 44 from 31 balls.
Kulasekara made 31 off 21 balls with one four and two sixes, while Thisara Perera returned unbeaten on 19.
Mashrafe Mortaza led the hosts after regular captain Mushfiqur Rahim was rested due to a hairline fracture in the left hand and Tamim Iqbal stepped down as vice-captain to concentrate on his batting.
Sri Lanka were without frontline batsman Mahela Jayawardene, who is missing the entire limited-overs series of two Twenty20 games and three one-day internationals due to a hand injury.
Sri Lanka won the preceding two-Test series 1-0. The second Twenty20 game will also be played in Chittagong on Friday.
Sri Lanka, the world's top-ranked Twenty20 side, made 168-7 after being sent in to bat and then restricted Bangladesh to 166-7 to take the lead in the two-match series.