Pakistan were all out for 451 in their first innings at tea on the second day of the first Test against Sri Lanka in Galle on Thursday.
Younis Khan made 177 and Sarfraz Ahmed and Abdur Rehman hit half-centuries to help the tourists pile up a big score.
Off-spinner Dilruwan Perera grabbed the last five wickets in the post-lunch session to finish with 5-137. Rangana Herath claimed 3-116.