But Bangladesh captain Mohammad Ashraful and teenager Mushfiqur Rahim frustrated the hosts by adding 191 for the sixth wicket, their country's best ever Test partnership.
The 22-year-old Ashraful, leading the side in his first series, remained unbeaten on 129, his fourth Test century and the third against Sri Lanka. He hit 18 boundaries.
Mushfiqur, 18, who replaced long-serving wicket-keeper Khaled Mashud for this match because of his batting abilities, justified his selection with 80.
The young duo surpassed Bangladesh's previous best partnership of 187 by Habibul Bashar and Shahriar Nafees for the second wicket against Australia in Fatullah last year.
It was left to prolific off-spinner Muttiah Muralitharan, kept wicketless for 26 overs, to break the partnership after tea when he accepted a return catch from Mushfiqur.
That triggered a dramatic collapse as Bangladesh lost their last five wickets in less than an hour, sliding from 269-5 to 299 all out.
Chaminda Vaas finished with four for 55, while Dilhara Fernando claimed 3-60. Muralitharan was restricted to just one wicket at the cost of 84 runs.
Sri Lanka had won last week's first Test at the Sinhalese Sports Club by an innings and 234 runs.
Sri Lanka have now won all their nine Test matches against Bangladesh since their first encounter in 2001, six of them by innings margins.
Five of the Tests ended in three days and the remaining four early on the fourth morning.
It was Bangladesh's 42nd defeat in 48 matches since they gained Test status in 2000 with five draws and a lone victory against Zimbabwe.
Ashraful said he was happy at scoring a century, but rued the team's collapse for their lowest Test score of 62 in the first innings.
“It is never easy to come back from that position,” he said. “We just have to bat better in the first innings and get a big score.
“It was a great partnership with Mushfiqur and we showed that Bangladesh were up for the challenge.
“But we needed at least two other such big stands to save the game. The boys are trying hard to learn the art of playing Test cricket. We won't give up.”
Sri Lankan captain Mahela Jayawardene attributed the win to an all-round effort after Kumar Sangakkara had made an unbeaten 200 on the second day.
“Sangakkara really shored up the innings although I was a bit disappointed that the other batsmen could not go on to get big scores,” said Jayawardene.
“But I can't praise the bowlers enough for toiling hard on a wicket that had nothing for them.
“Vaas is a top performer as is Murali, they are great at creating opportunities. It helps that we also have two bowlers in (Lasith) Malinga and Fernando who bowl consistently at 90 miles an hour.”
The final Test starts in Kandy on July 11.
Scoreboard
BANGLADESH (1st Innings) 62 (M. Muralitharan 4-14, S.L. Malinga 4-25).
SRI LANKA (1st Innings) 451-6 declared (K.C. Sangakkara 200 not out, B.S.M. Warnapura 82).
BANGLADESH (2nd Innings, overnight 69-4):
Javed Omar lbw b Vaas 28
Shahriar Nafees c P. J’wardene b Vaas 20
Rajin Saleh c M. J’wardene b Fernando 0
Mehrab Hossain Jr b Fernando 8
Habibul Bashar b Fernando 12
Mohammad Ashraful not out 129
Mushfiqur Rahim c and b Murali 80
Mohammad Sharif lbw b Vaas 2
Mashrafe Mortaza lbw b Vaas 0
Mohammad Rafique run out 3
Shahadat Hossain run out 2
EXTRAS (B-2, LB-2, W-2, NB-9) 15
TOTAL (all out, 86.3 overs) 299
FALL OF WKTS: 1-48, 2-51, 3-55, 4-59, 5-78, 6-269, 7-276, 8-276, 9-286.
BOWLING: Vaas 20.3-8-55-4; Malinga 15-1-86-0 (7nb, 2w); Fernando 17-2-60-3 (2nb); Muralitharan 28-6-84-1; Dilshan 6-1-10-0.
RESULT: Sri Lanka won by an innings and 90 runs.
UMPIRES: Asad Rauf (Pakistan) and R.E. Koertzen (South Africa).
TV UMPIRE: E.A.R. de Silva (Sri Lanka).
MATCH REFEREE: J.J. Crowe (New Zealand).
MAN-OF-THE-MATCH: Kumar Sangakkara.
FIRST TEST: Colombo (SSC), Sri Lanka won by an innings and 234 runs.
THIRD TEST: Kandy, July 11-15.—AFP