The left-arm spinner finished with 5-68, his 15th haul of five or more wickets in a Test innings, while fast bowler Nuwan Kulasekara took three wickets as the tourists were all out in the last session after being put in to bat.
Sri Lanka lost opener Tillakaratne Dilshan for no score before reaching 18-1 in reply at stumps. Opener Dimuth Karunaratne was unbeaten on 12 with Kumar Sangakkara (three not out).
Mominul Haque top-scored for Bangladesh with an impressive 64. Nasir Hossain (48), opener Jahurul Islam (33) and Sohag Gazi (32) were the other main scorers.