Azhar Ali was unbeaten on six after Younis Khan was run out off the last ball of the morning session.
Sri Lanka added six runs to their overnight score of 272-8 before they were all out within 20 minutes of the start. Leg-spinner Yasir Shah finished with 5-78 runs and seamer Rahat Ali took three wickets.
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.