Rangana Herath again put Pakistan in a spin with a five-wicket haul but half-centuries from Sarfraz Ahmed and Ahmed Shehzad guided the tourists to 244 for six at the close of the second day of the second test overnight.
Pakistan trail Sri Lanka, who lead the two-test series 1-0, by 76 runs after the hosts were bowled out for 320 in their first innings.
Herath took the wickets of experienced pair Younis Khan and captain Misbah-ul-Haq in seven balls after tea to reduce Pakistan to 140-5, but Asad Shafiq (42) and Sarfraz (66 not out) added 93 for the sixth wicket before Herath separated them towards the end of the day.
He bowled Shafiq between bat and pad with an arm ball as the batsman prodded forward to finish the day with figures of five for 98.
Herath is the leading wicket-taker in test cricket for the calendar year with 47 wickets.
''We need to get them out for under 300 then we have a 20 plus lead and if we can get more runs we can put them under pressure,'' Herath said.
''We need to bat very well in the second innings. There is some help for the spinners but not that much, still it is the second day. By the third and fourth days it should take spin.''
Sarfraz reached his third consecutive half-century of the series after successfully reviewing a lbw dismissal off Dilruwan Perera when he had made 24.
''I played my natural game and this is what exactly (coach)Waqar Younis told me to do,'' said Sarfraz.
''We are here to play positive cricket and to win. My immediate target tomorrow is to run down the deficit on us and revert the pressure back on Sri Lanka.''
Earlier, Pakistan left-arm paceman Junaid Khan completed his fifth five-wicket haul against Sri Lanka but not before the hosts' tailenders frustrated them to add 59 valuable runs in the morning.
Pakistan's hopes of finishing off the Sri Lankan innings quickly were stalled by Dhammika Prasad (13), Herath (17) and Chanaka Welegedara (27 not out).
Should bouncers be banned from cricket?