In the process, Bangladesh levelled the series 1-1. Chasing the Tigers' 176/9, Sri Lanka were bundled out for 131 in 18 overs.
All-rounder Shakib al Hasan opened the bowling and brought immediate success in just the second delivery of Sri Lanka's innings. Opening batsman Kusal Perera, player of the match in the first T20I, was cleaned up while trying to cut a ball that was too close to the stumps.
Shakib also got the wicket of other opener Dilshan Munaweera in the third over. The Lankans then lost their third wicket with the scoreboard reading 40; Mahmudullah accounting for the scalp of makeshift skipper Upul Tharanga.
Paceman Mustafizur Rahman soon bagged two quick wickets in the first two balls of the sixth over, leaving the Lankans in dire straits.
All-rounders Thisara Perera and Chamara Kapugedera then formed a 58-run partnership for the sixth wicket but it was not enough for the home side.
Kapugedera top-scored with 50 while Thisara made 27.
Mustafizur took four wickets conceding 21 runs while Shakib notched three. Captain fantastic Mashrafe picked up one wicket, that of all-rounder Seekkuge Prasanna, in his final T20I appearance.
Earlier, Mashrafe won the toss and elected to bat first.
Bangladesh made two changes in their starting XI from the first T20I. Regular opener Tamim Iqbal was ruled out due to back pain and in came Imrul Kayes as his replacement while off-spinner Mehedi Hasan Miraz made his debut, replacing fast bowler Taskin Ahmed.
Openers Soumya Sarkar and Imrul made a flying start as Bangladesh cruised to 68 in their first six overs.
Part-time seamer Asela Gunaratne initiated the first breakthrough as Soumya presented him a return catch in the seventh over. Soumya scored a brisk 17-ball 34 with four fours and two sixes.
Imrul got out in the very next over while taking a quick single. And from a very good start, the Tigers lost two quick wickets.
Following No 3 Sabbir Rahman’s (19) dismissal, Shakib played a good knock in the middle overs before being dismissed for 38.
Bangladesh’s hopes of adding some quick runs at the death overs however, were thwarted by seamer Lasith Malinga in the 19th over. Malinga clinched his fourth hat-trick in international, dismissing wicketkeeper-batsman Mushfiqur Rahim (15), Mashrafe (nought) and Miraz (nought).
Shakib was named player of the match for his all-round efforts while Malinga was adjudged man of the series.
131 in 18 overs (Kapugedera 50, Mustafizur 4/21, Shakib 3/24) lost to Bangladesh
176/9 (Shakib 38, Imrul 36, Malinga 3/34) by 45 runs