Sri Lanka, who drew the opening Test in Galle, achieved a 160-run target in the last session as opener Tillakaratne Dilshan (57) and Kumar Sangakkara (55) made impressive half-centuries.
Bangladesh, trailing by 106 runs on the first innings, were dismissed for 265 in their second innings in the morning session.
Tamim Iqbal (59), Jahurul Islam (48) and skipper Mushfiqur Rahim (40) were the main scorers for Bangladesh, while Sri Lankan left-arm spinner Rangana Herath finished with a career-best 7-89 on his 35th birthday.
The hosts on Monday were bowled out for 346 in their first innings in reply to Bangladesh's 240.
Bangladesh and Sri Lanka will now play a three-match one-day series, starting in Hambantota on Saturday.
Bangladesh 240 and 265; Sri Lanka 346 and 160-3
In pictures: A look at Anil Kumble's illustrious cricket career
Photos: Karisma Kapoor, Preity Zinta, Shraddha Kapoor at Mumbai airport
Spotted: Anushka Sharma and Diljit Dosanjh at Mumbai studio
Photos: Mallika Sherawat at a restaurant in Bandra
Photos: Tina Ahuja, Gizele Thakral at a calendar launch