The second and final Test starts in Chittagong on January 3. The tourists, struggling at 172-6 on Friday, were bowled out for a respectable 293 on the stroke of lunch, thanks to middle-order batsman Samaraweera's 141-ball knock.
Samaraweera looked set to complete his eighth Test century before being the last man out, caught by Junaid Siddique at first slip off left-arm spinner Shakib Al Hasan after hitting 13 fours.
Hasan bagged two of the four wickets that fell in the morning session to finish with an impressive 5-70, his third successive haul of five or more wickets in a Test innings.
Seamers Mashrafe Mortaza and Shahadat Hossain took two wickets apiece.
Sri Lanka denied the hosts success for nearly two hours in the morning session, with Samaraweera and lower-order batsman Chaminda Vaas adding 99 for the seventh wicket.
Mortaza broke their stand with the second new ball when he had Vaas caught behind for 37, which included six fours.
The tourists' innings did no