Chittagong - Bangladesh, replying to Sri Lanka's first innings total of 587, were 409-8 at stumps on the third day of the second and final Test in Chittagong on Thursday.
Shamsur Rahman (106) and Imrul Kayes (115) put on 232 for the second wicket before both were bowled by Ajantha Mendis.
Shakib Al Hasan scored 50 as Bangladesh saved the follow-on and ended the day trailing Sri Lanka by 178 runs on the first innings with two wickets in hand.
Sri Lanka won the first Test by an innings and 248 runs in Dhaka last week.