Pakistan leg spinner Danish Kaneria took five for 62 to help bowl Sri Lanka out for 233 on an action-packed second day of the third test on Tuesday.
Kaneria, playing his first game of the series, bowled superbly to give Pakistan a 66-run first-innings lead. The tourists lost opener Khurram Manzoor in the final over before stumps, bowled by left-arm spinner Rangana Herath, and finished on 16 for one, a lead of 82 runs. Fawad Alam was on 14 and Younus Khan on nought.
Mahela Jayawardene top-scored for the hosts with a skilful 79 (153 balls) including 10 boundaries.
Tillakaratne Dilshan also scored a gutsy 44 batting with a fractured right index finger and Kumar Sangakkara made a fluent 45.
Sri Lanka, 2-0 up in the series, needed just 3.4 overs in the morning to end the Pakistan innings after the visitors had resumed on 289 for seven.