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.
Leg-spinner Yasir Shah (5-95) dismissed Dinesh Chandimal and Kithuruwan Vithanage cheaply after lunch, having also been involved in Kaushal Silva's (80) run out that pegged back Sri Lanka.
Shot out for 138 in their first innings, Pakistan received another jolt when Wahab Riaz, nursing a hand injury sustained while batting, was ruled out of the entire series, taking much of the sting off his team's pace attack.
Resuming on 70 for one, Sri Lanka lost Kumar Sangakkara (34) before reaching the 100-run mark after the southpaw played a lofted shot against left-arm spinner Zulfiqar Babar and Asad Shafiq ran backwards to take a good catch at long on.
Pakistan's improved catching also sent back Lahiru Thirimanne who offered a bat-pad catch off Shah and an alert Azhar Ali pouched it at short leg in his second attempt.
Mathews and Silva added 72 runs to steady the innings before a miscommunication led to the opener being run out after a patient 218-ball knock that included 10 boundaries.
Shah, who took seven second innings wickets at Galle to set up Pakistan's comprehensive victory in the first test, then dealt two quick blows castling Chandimal and Vithanage who paid the price for poor shot selection.
Pakistan lead the three-match series after winning the first Test in Galle by 10 wickets.
Brief scores
Pakistan - 138 (Hafeez 42, Kaushal 5-42, Prasad 3-43)
Sri Lanka - 304/9 (Silva 80, Mathews 77, Yasir Shah 5-95)
Status - Sri Lanka lead by 166-runs