The Lankans however, struck back with three quick wickets in the last hour of the game to wrest away the initiative. Bangladesh's 100th Test is evenly balanced at the moment with Shakib al Hasan (18) and Mushfiqur Rahim (two) unbeaten at the crease.
Bangladesh are still trailing by 124 runs with five wickets in hand.
Openers Soumya Sarkar and Tamim Iqbal added 95 runs, thus laying the foundation for a big total.
Bangladesh started their first innings just after lunch and these two in-form left-handers batted throughout the whole session before Tamim was trapped in front by interim captain Rangana Herath. Tamim scored 49 off 91 deliveries with half a dozen boundaries.
Soumya soon registered his fourth half-century, making 61 off 121 balls with the help of six boundaries. Lakshan Sandakan cleaned him up with a wrong-un in the 42nd over.
Imrul Kayes and Sabbir Rahman posted 34 and 42 respectively but both the batsmen got out after being well set.
Sandakan was the star performer for the Lankans as the chinaman bowler picked up three wickets conceding 65 runs.
Earlier, overnight batsman Dinesh Chandimal smashed his eighth century, guiding his side to 338.
Sri Lanka were 238/7 after day one and added exactly 100 more runs losing their remaining three wickets.
Shakib took the first wicket when Herath was caught at first slip in the ninth over of the day.
At the other end though, Chandimal played some delightful shots but was eventually dismissed for 138 off 300 balls, hitting 10 boundaries and a six.
Sri Lanka's ninth- and 10th-wicket partnership hurt Bangladesh, adding 55 and 35 runs respectively.
Mehedi Hasan Miraz picked up three wickets conceding 90 runs while Mustafizur Rahman took two for 50.
338 in 113.3 overs (Chandimal 138, Miraz 3/90) lead Bangladesh
214/5 in 60 overs (Soumya 61, Tamim 49)