COLOMBO - Opener Tamim Iqbal top-scored with 82 as Bangladesh pulled off a historic four-wicket win over Sri Lanka in the second Test in Colombo on Sunday.

The rare win for Bangladesh -- just their fourth away from home and first against Sri Lanka in 18 attempts -- meant the two-Test series was drawn after the visitors suffered a 259-run loss in Galle. Bangladesh Prime Minister Sheikh Hasina phoned the team to congratulate them as hundreds of fans marched through the capital Dhaka, waving flags and chanting in celebration.

With his team chasing a victory target of 191, teenager Mehedi Hasan hit the winning run after an anxious half-hour in the final session of the fifth day -- getting Bangladesh across the line in 57.5 overs. Tamim laid the groundwork with his 22nd Test fifty, teaming up with Sabbir Rahman (41) for a third-wicket partnership of 109. Sri Lanka struck in phases through spinners Dilruwan Perera and skipper Rangana Herath, who grabbed three wickets each. But the attack lacked the cutting edge to prevent Bangladesh from celebrating their 100th Test match in style.

Bangladesh began looking nervous when Tamim -- who faced 82 balls and hit seven fours and a six -- hoisted a catch to Dinesh Chandimal off Perera just before the tea break.  Perera then removed Sabbir through a successful review after the bowler's initial appeal for a leg-before was rejected, giving Sri Lanka an outside chance of victory.

Skipper Mushfiqur Rahim and Shakib Al Hasan got Bangladesh through to tea with 35 runs still needed, but Perera got a lucky break soon after the resumption when Shakib dragged a ball onto his stumps and was out for 15. Mushfiqur remained unbeaten on 22 to get Bangladesh home in company with Mehedi, after some support from debutant Mosaddek Hossain, who made 13. "Obviously I feel great," Mushfiqur said. "The boys really stepped up under pressure and there were lot of partnerships in the bowling. I really enjoyed it. If you look at the last few series, we have played some good cricket."

Herath appeared to have given Sri Lanka some control when he picked up two wickets in two balls to leave Bangladesh struggling on 38-2 at the lunch break. He claimed his first wicket when opener Soumya Sarkar, charging down the pitch, was deceived by the turn and lofted a catch to Upul Tharanga at mid-off for 10. Imrul Kayes then edged the next ball to Asela Gunaratne in the slips for a duck.

Herath said Sri Lanka would go back to the drawing board after suffering their first defeat of his captaincy. "We have a lot of areas to improve, but this is not the time to talk about it. We will talk with the coaches," he said.

Earlier in the day Perera and Suranga Lakmal frustrated Bangladesh for more than an hour with the bat as Sri Lanka added 51 to their overnight 268-8. Perera scored his fourth Test fifty off 174 balls while tail-ender Lakmal smashed 42 off 48 balls. The pair shared 80 runs for the ninth wicket before Bangladesh separated them through a run out. Tamim was named man of the match while Shakib, who scored a century and claimed six wickets in the game, took the award for player of the series. "This was a very important win. It wasn't easy. We had to come back strong after the first Test," Shakib said.

Scoreboard

SRI LANKA 1ST INNINGS: 338
BANGLADESH 1ST INNINGS: 467
SRI LANKA 2ND INNINGS:
(OVERNIGHT: 268-8):
D Karunaratne c Soumya b Shakib 126
U Tharanga b Mehedi 26
K Mendis c Mushfiqur b Mustafizur 36
D Chandimal c Mushfiqur b Mustafizur 5
A Gunaratne lbw b Shakib 7
D de Silva c Mushfiqur b Mustafizur 0
N Dickwella c Mushfiqur b Shakib 5
D Perera run out 50
R Herath lbw b Taijul 9
S Lakmal c Mosaddek b Shakib 42
L Sandakan not out 0
EXTRAS: (b4, lb8, w1) 13
TOTAL: (all out; 113.2 overs) 319
FOW: 1-57, 2-143, 3-165, 4-176, 5-177, 6-190, 7-217, 8-238, 9-318, 10-319.
BOWLING: Roy 16-4-36-0, Mehedi 24-0-71-1, Mustafizur 23-3-78-3, Shakib 36.2-9-74-4, Mosaddek 3-0-10-0, Taijul 11-1-38-1.
BANGLADESH 2ND INNINGS:
Tamim Iqbal c Chandimal b Perera 82
Soumya Sarkar c Tharanga b Herath 10
Imrul Kayes c Gunaratne b Herath 0
Sabbir Rahman lbw b Perera 41
Shakib Al Hasan b Perera 15
Mushfiqur Rahim not out 22
Mosaddek c Dickwella b Herath 13
Mehedi not out 2
EXTRAS: (b4, lb1, w1) 6
TOTAL: (six wickets; 57.5 overs) 191
FOW: 1-22, 2-22, 3-131, 4-143, 5-162, 6-189.
BOWLING: Perera 22-1-59-3, Herath 24.5-2-75-3, de Silva 2-0-7-0, Sandakan 6-1-34-0, Lakmal 2-0-7-0, Gunaratne 1-0-4-0.
TOSS: Sri Lanka
UMPIRES: Aleem Dar (PAK) and Sundaram Ravi (IND)
TV UMPIRE: Marais Erasmus (RSA)
MATCH REFEREE: Andy Pycroft (ZIM)