Tamim Iqbal's breezy fifty, a gritty knock from Mominul Haque and late-day rain guided Bangladesh to a draw with Sri Lanka on the final day of the bat-dominated first Test in Kandy.
Sri Lanka had faint hopes of forcing victory after declaring on a mammoth 648-8 - giving them a first-innings lead of 107 - and then reducing Bangladesh to 27-2 in the second session.
However, Tamim (74no off 98 balls) and Bangladesh skipper Mominul (23no off 86) steadied their side with contrasting innings after Suranga Lakmal had removed Saif Hassan for one and then Nazmul Hossain Shanto - who scored 167 in the Tigers' first innings - for an eight-ball duck.
Tamim struck three sixes and 10 fours in his 30th Test half-century but Mominul - who had hit his first overseas Test ton in his team's first-innings 541-7 declared - scored no boundaries as he dropped anchor.
Bangladesh were 100-2 at tea but no further play was possible after that due to rain as a Test in which 1,289 runs were scored and only 17 wickets fell ended in a stalemate.
Sri Lanka captain Dimuth Karunaratne (244) and Dhananjaya de Silva (166) had earlier extended their partnership to a massive 345, the highest fourth-wicket stand in a Test in Sri Lanka.
Karunaratne and Dhananjaya were both dismissed by Taskin Ahmed (3-112) before Wanindu Hasaranga hit a quick-fire 43 to take the hosts' lead past 100.
Sri Lanka's victory push was then snuffed out so the sides remain all square heading into the second and final Test, also in Kandy, from Thursday.