Sri Lanka 397 (Mathews 199, Chandimal 66, Nayeem 6-105) and 260 for 6 (Dickwella 61*, Karunaratne 52, Taijul 4-82) drew with Bangladesh 465 (Tamim 133, Mushfiqur 105, Rajitha 4-60)
Chattogram: Sri Lanka and Bangladesh shared four points each in the ICC World Test Championship with a draw in the first Test of the two-match series.
Some brilliant bowling from Bangladesh on the final day made things interesting in the final Test.
Taijul Islam led Bangladesh's attack with guile and spin and at 161/6, the home side would have fancied their chances to bowl the opposition out.
However, resistance from Dinesh Chandimal and Niroshan Dickwella, who put on an unbeaten 99-run stand for the seventh wicket, meant both teams had to settle for a draw.
The result means Sri Lanka and Bangladesh remain rooted to the fifth and eighth spot respectively on the World Test Championship table.
Earlier in the match, Sri Lanka won the toss and opted to bat first.
The visitors posted 397 on the back of a brilliant century from Angelo Mathews. He came agonizingly close to a double century, falling one run short of it as he was the last Sri Lankan wicket to fall.
Nayeem Hasan, playing his eighth Test, recorded his second fifer and finished with his best innings figures of 6/105.
In reply, centuries from veterans Tamim Iqbal and Mushfiqur Rahim helped Bangladesh gain a 68-run lead.
It was an innings to remember for Rahim, who scored his eighth Test hundred and en route became the first Bangladesh batter to score 5000 Test runs.
On the final day, Bangladesh were in with a chance to bowl Sri Lanka out but Chandimal and Dickwella stood in their way with a patient, unbeaten partnership of 99 runs.
Resuming the day on 39/2, still 29 runs behind Bangladesh, Kusal Mendis decided attack was the best form of defence and played a counter-attacking innings that quickly wiped out the deficit.