Colombo - Sri Lanka, replying to Pakistan's first innings total of 138, were 304-9 at stumps on the second day of the second Test in Colombo on Friday.
Opener Kaushal Silva top-scored with 80 and skipper Angelo Mathews made 77, but Sri Lanka lost six wickets for 112 runs after being 191-3 at one stage.
Leg-spinner Yasir Shah claimed five wickets to restrict Sri Lanka's lead to 166 runs runs.
Pakistan lead the three-match series after winning the first Test in Galle by 10 wickets.