Pakistan seam bowlers Junaid Khan and Wahab Riaz shared seven wickets as the tourists came back strong on the opening day of the second Test, limiting Sri Lanka to 261-8 at stumps.
Khan returned his best figures of 4-69 and Riaz supported him well with 3-66, including the wicket of opener Upul Tharanga eight runs short of his second Test century.
Riaz added the price wicket of in-form Kumar Sangakkara (22), who had made a double-century in the first innings of the first Test. He also dismissed captain Angelo Mathews (39) caught behind in what became the last ball of the day.
Sri Lanka's solid start included 69 runs in the first session without losing a wicket and in the second they lost two wickets for 93 runs. After lunch, opener Kaushal Silva prodded at a delivery but was caught behind for 41 off Khan. Sangakkara made 22 before being bowled by Riaz off the inside edge.
Sangakkara's dismissal saw Mahela Jayawardene, who plays his final Test, walk in to a guard of honor by the Pakistani fielders and sounds of fireworks. But he could make just four to the disappointment for a modest crowd most of whom were past and present students from his school.
Jayawardene was trapped lbw by offspinner Saeed Ajmal soon after tea break.
After a dramatic seven-wicket win in the first Test, Sri Lanka is aiming to sweep the Two-test series and send the retiring Jayawardene out on a winning note.