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.
Sri Lanka first innings 320
Pakistan first innings
K Manzoor c Dickwella b Herath 23
A Shehzad c Dickwella b D. Perera 58
A Ali c Mathews b Herath 32
Y Khan c Dickwella b Herath 13
Misbah c Dickwella b Herath 5
A Shafiq b Herath 42
S Ahmed not out 66
A Rehman not out 1
Extras (lb-3 nb-1) 4
Total (for 6 wickets, 70 overs) 244
Fall of wickets: 1-47, 2-110, 3-122, 4-131, 5-140, 6-233
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 Younus 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.
Sarfraz reached his third consecutive half-century of the series after successfully reviewing a lbw dismissal off Dilruwan Perera when he had made 24.
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).