Dilshan was unbeaten on 52, while Sangakkara proved a more than capable foil on 33 not out as the hosts reached 103 for one at tea on day four and require another 57 runs for victory in the second and final Test against the Tigers.
Bangladesh were earlier all out for 265 before lunch and that was largely due to the efforts of Herath, who marked his 35th birthday with career-best Test figures of seven for 89 - which included his 200th scalp in the five-day format.
Resuming on 158 for four overnight, the tourists' attempts to set a more challenging total were undermined by the steady fall of wickets during the morning session.
Dimuth Karunaratne was the only Sri Lankan wicket to fall before tea, the opener offering no shot to a ball that came back into him from Robiul Islam and was trapped lbw for 16.

