Upul Tharanga was unbeaten on 28 and Kaushal Silva was on 38, the pair emerging unscathed from the morning session on a good batting wicket.
Sri Lanka had won the first Test in Galle by seven wickets.
The match is the last one for former Sri Lankan captain Mahela Jayawardene, who will quit Test cricket to play only one-day internationals until next year's World Cup in Australia and New Zealand.