Dinesh Chandimal struck his eighth Test century as Sri Lanka's tail frustrated Bangladesh's bowlers in the second Test Thursday before being dismissed for 338 at the end of the morning session.
The hosts were all out on the stroke of lunch on the second day at Colombo's P. Sara Oval, after adding exactly 100 to their overnight 238-7, much to the frustration of the visitors who were playing their 100th Test.
Chandimal, who was unbeaten on 86 overnight, made 138 off 300 balls after an innings which contained more than its share of good fortune.
After surviving two TV reviews on the first day, he was again given out caught behind on Thursday off Mustafizur Rahman's bowling but the decision was overturned when replays showed the ball had not touched his bat.
Bangladesh were hoping to wrap up the innings quickly once Shakib Al Hasan removed Rangana Herath for 25 in the ninth over of the morning after the Sri Lankan skipper added just seven runs to his overnight score.
Soumya Sarkar managed to grasp the catch after several fumbled attempts but Chandimal and Lakmal then continued to frustrate Bangladesh as they put on a 55-run partnership for the ninth wicket.
Off-spinner Mehedi finally dismissed Chandimal, who now has four Test centuries against Bangladesh in six Tests, as debutant Mosaddek Hossain took the catch at midwicket.
Chandimal, who struck only four boundaries on the opening day while helping his side recover from 70-4, batted aggressively on the second day to hit 10 fours and a six overall in his innings.
Lakmal swung his bat to add 35 runs to Sri Lanka's total before he became the last man to be dismissed with a catch to Soumya at third man off pace bowler Subashis Roy.
Mehedi finished with 3-90 for Bangladesh.