Bangladesh celebrated their 100th Test in memorable fashion, defeating Sri Lanka for the first time to square the series in Colombo.
Sri Lanka 1st inns: 338 (Chandimal 138; Miraz 3-90, Rahman 2-50).
Bangladesh 1st inns: 467 (Al Hasan 116, Hossain 75, Sarkar 61, Rahim 52; Herath 4-82, Sandakan 4-140)
Sri Lanka 2nd inns: 319 (Karunaratne 126, Perera 50, Lakmal 42, Mendis 36; Rahman 3-78, Hasan 4-74)
Bangladesh 2nd inns: 191-6 (Iqbal 82, Rahman 41; Perera 3-59, Herath 3-75)
Bangladesh won by four wickets
Bangladesh celebrated their 100th Test in memorable fashion, defeating Sri Lanka for the first time to square the series in Colombo.
The four-wicket win on the final day at the P Sara Oval will go down as one of the Tigers' finest results and their ninth at this level.
The hosts set a challenging winning mark of 191, boosted by important tail-end runs in the morning from Dilruwan Perera (50) and Suranga Lakmal (42), who took Sri Lanka from their overnight 268 for eight to 319 all out.
Shakib Al Hasan wrapped things up by dismissing Lakmal, finishing with figures of four for 74.
Rangana Herath scuppered hopes of a solid start to the chase, removing Soumya Sarkar and Imrul Kayes, but Tamim Iqbal played a mature knock to keep Bangladesh in the hunt.
He put on 109 with Sabbir Rahman, before he was eventually undone by Perera for a vital 82.Perera threatened to get on a roll, picking off Rahman for 42 then claiming the prized scalp of Shakib to make it 162 for five.
Mushfiqur Rahim, the touring captain, was left to usher his side towards the line after overturning an lbw decision on review, and 19-year-old Mehedi Hasan had the honour of striking the winning runs.
Shakib Al Hasan and Mustafizur Rahman shared six wickets as Bangladesh closed in on a possible first ever Test win over Sri Lanka in Colombo.
The tourists bowled themselves into a strong position on day four of the second Test, despite home batsman Dimuth Karunaratne's century, as Sri Lanka led by 139 runs with just two wickets remaining in their second innings.
His hundred looked to be largely in vain as his team-mates failed to back him up on a day when Bangladesh made major strides towards squaring the two-match series and ending a run of 15 defeats and two draws in 17 previous meetings.
Karunaratne turned his overnight 25 into 126, including one six and 10 fours, as he formed a second-wicket stand of 86 with Kusal Mendis following the early loss of Upul Tharanga for 26.
Sri Lanka had begun the day on 54 without loss but following Tharanga's dismissal and that of Mendis, for 36, they failed to get into any real rhythm as Shakib (three for 61) and Mustafizur (three for 52) took charge.
Sri Lanka's wickets fell at regular intervals but it was the dismissal of century-maker Karunaratne which was a crucial blow for the tourists. The home side had taken the total to 217 when he fell victim to Shakib to become seventh wicket down in the final session of the day.
Shakib pitched a delivery outside off and when Karunaratne edged the ball to first slip, Soumya Sarkar took the catch to bring his day-long vigil to an end.
Sri Lanka also lost Rangana Herath for nine before the close as they ended the day on 268 for eight and a lead of 139.
It was left up to Dilruwan Perera (26 not out) and Suranga Lakmal (16 not out) to carry their hopes of avoiding a first defeat to Bangladesh on the final day.
Shakib Al Hasan's fifth Test century helped Bangladesh take an unfamiliar first-innings lead over hosts Sri Lanka in the second Test.
Needing victory to share the series and responding to Sri Lanka's 338 all out, a score dominated by Dinesh Chandimal's 138, Shakib started the day with 18 of an overnight 214 for five at Colombo's P Sara Oval.
The all-rounder, batting at number six, went on to make 116 of the Tigers' 467 all out, giving them a first-innings advantage of 129 which Sri Lanka reduced with 54 for no wicket by stumps.
First playing himself in, Shakib and fellow veteran Mushfiqur Rahim, resuming on two, added 92 for the sixth wicket until Mushfiqur was bowled for 52 by Suranga Lakmal with lunch approaching.
Shakib found a new ally in Test debutant Mosaddek Hossain as Bangladesh took a first-innings lead for only the second time while batting second in an away Test, having last done so against Sri Lanka in 2013.
Shakib, dropped on 67 by wicketkeeper Niroshan Dickwella albeit a difficult chance while standing up to the stumps, and Mosaddek shared a hundred partnership shortly before the latter raised a fifty and the former his ton. The stand was worth 131 when Shakib fell just before tea, chipping Lakshan Sandakan to mid-on.
As Mosaddek pushed on Rangana Herath struck twice in two balls shortly before having the debutant stumped for 75, a score that included the only two sixes of the innings. Herath returned figures four for 82 and Sandakan four for 140.
Opening batsmen Dimuth Karunaratne and Upul Tharanga (both 25no) had few alarms before stumps when the hosts trailed by 75.
A century for Dinesh Chandimal and three late wickets in the space of seven deliveries helped put Sri Lanka in command on day two of the second Test against Bangladesh in Colombo, where the tourists trailed by 124 runs.
Resuming on 86 with the hosts at 238 for seven overnight, Chandimal chalked up his eighth Test hundred as Sir Lanka were eventually all out for 338.
Bangladesh, who were playing their 100th Test match, lost opener Tamim Iqbal for 49 and Soumya Sarkar for 61 before three costly late wickets saw their progress checked to 214 for five at stumps.
Earlier, Bangladesh had hoped to mop up the Sri Lanka tail quickly once captain Rangana Herath had departed for 25 following a thick edge off Shakib Al Hasan to Soumya at first slip with the total at 250.
However, Suranga Lakmal, who finished with a battling 35, helped Chandimal bring up his century and provide some late resistance as Sri Lanka moved past 300.
Chandimal, though, needed a review to remain at the crease when on 113 after he was initially given out caught behind off Mustafizur Rahman, with replays showing their was no contact with his bat.
Eventually, Bangladesh had Chandimal dismissed just before lunch when an attempted sweep off Mehedi Hasan fell to Mosaddek Hossain at midwicket, his 138 coming off 300 deliveries as he left the field at the P Sara Oval to a standing ovation.
In reply, Tamim and Soumya put on an opening 95-run partnership before Sri Lanka made the breakthrough just before tea when Tamim was trapped lbw by Herath just one run short of a half-century. Soumya was then bowled by Lakshan Sandakan, with Bangladesh at 130 for two.
Imrul Kayes, who suffered an injured toe whilst fielding, had added 34 when he went the same way in the 57th over as Sandakan struck him on the pads in front of off stump.
Nightwatchman Taijul Islam was then sent straight back to the pavilion next ball without troubling the scorers after Sandakan's delivery spun back in sharply, with the dismissal given on review .
Bangladesh's earlier hard work was quickly being undone during the closing session as Sabbir Rahman gloved a short delivery from Suranga Lakmal to leg gully where Dhananjaya de Silva took a diving catch to leave the hosts at 198 for five.
Shakib Al Hasan finished 18 not out and captain Mushfiqur Rahim on two as Bangladesh edged through to the close without suffering any more losses.
Sandakan ended the day with three for 65 to help Sri Lanka wrestle back the advantage.
Dinesh Chandimal's unbeaten 86 helped Sri Lanka fight back from a dismal morning session on day one of the second Test against Bangladesh in Colombo.
With the hosts on 70 for four at lunch, Chandimal weathered the storm to register his 12th Test fifty and leave Sri Lanka on 238 for seven at stumps.
Teenage off-spinner Mehedi Hasan and paceman Mustafizur Rahman both grabbed two wickets apiece as Bangladesh made a strong start to their 100th Test match at the P Sara Oval.
Bangladesh got off to a flyer in their landmark Test as Mustafizur forced a thick edge off opener Dimuth Karunaratne who was the first man to go for seven, with Mehedi taking a superb catch at gully.
Kusal Mendis, who claimed man-of-the-match honours in the first Test, was then dismissed for five as a Mehedi had him stumped by wicketkeeper Mushfiqur Rahim. Sri Lanka's innings went from bad to worse when Upul Tharanga edged Mehedi to Soumya Sarkar at slip for 11, having already been given a reprieve by a television replay when given out lbw off Mustafizur for six.
After Asela Gunaratne was trapped lbw by Subashis Roy for 13 at the stroke of lunch, Dhananjaya de Silva, who came into the side for Lahiru Kumara, and Chandimal put on a 66-run partnership, with Chandimal reaching his half-century in the process.
De Silva went on to hit a quickfire 34 off 54 balls, including five boundaries, before being dismissed by spinner Taijul Islam. Niroshan Dickwella produced an attack-minded 34 to help Sri Lanka reach 180 for five but the hosts lost another wicket when he was bowled by Shakib Al Hasan.
Dilruwan Perera fell for nine off Mustafizur before Chandimal, who faced a total of 210 balls, and Rangana Herath (18 not out) guided the hosts to the close. Bangladesh batsman Imrul Kayes suffered an injured toe whilst fielding but is expected to be fit for day two.