Dimuth Karunaratne was unbeaten on 34 and Upul Tharanga was on 39, the pair having put on 70 for the second wicket after Kaushal Silva was dismissed for nine.
The series is tied at 1-1 after Pakistan won the first Test in Galle by 10 wickets and Sri Lanka took the second in Colombo by seven wickets.