Bangladesh 23 for no loss in second innings
Tamim Iqbal was unbeaten on 13 at the break with Jahurul Islam nine not out.
The hosts were earlier bowled out for 346 in their first innings in reply to Bangladesh's 240.
Kumar Sangakkara (139) and Dinesh Chandimal (102) were the main scorers for Sri Lanka, while off-spinner Sohag Gazi took three wickets for Bangladesh.
The opening Test ended in a draw.