Mahela Jayawardene scored four streaky runs in his last Test as Pakistan's bowlers dismantled Sri Lanka's first innings at the start of the second and final match in Colombo on Thursday.
The hosts, who won the toss and elected to bat on the easy-paced wicket, found runs hard to come by against the steady attack and plodded to 261-8 by stumps on the opening day at the Sinhalese Sports Club.
Upul Tharanga hit 92 and fellow opener Kaushal Silva made 41, but Sri Lanka lost seven wickets on either side of the tea interval after coasting at 144-1.
Pakistan's two left-arm seamers Junaid Khan and Wahab Riaz toiled manfully under the hot sun to share seven wickets and lead a spirited display by the tourists seeking a series-levelling win.
Junaid ended the day with four for 69, including two wickets in the first over with the second new ball taken towards the end of the day's play. Riaz had three for 66.
Sri Lanka's skipper Angelo Mathews made 39 when he was caught behind off Riaz for what became the last delivery of the day.
Tharanga put on 79 for the first wicket with Silva and 65 for the second with Kumar Sangakkara, but missed his century when he fell to a sharp catch by Azhar Ali at short-leg off Riaz.
Sangakkara, who hit 221 in the first Test in Galle which Sri Lanka won by seven wickets, managed just 22 when he was bowled by a superb in-cutter from Riaz.
Standing ovation for Jayawardene
Pakistan's fielders lined up to greet Jayawardene, a 37-year-old veteran of 149 Tests, to the crease as firecrackers went off in the stands and some 3,000 home fans gave him a standing ovation.
But the star batsman, who was dropped by wicket-keeper Sarfraz Ahmed off Junaid just before tea, fell in the first over after resumption when he was trapped leg-before by Saeed Ajmal.
Ajmal, who will have his bowling action tested at the end of the month after being reported by the umpires in Galle, bowled 29 overs to take one for 67.
The SSC, which has been Jayawardene's home ground since his early days, was decorated with giant posters of the elegant batsman, many of them highlighting his career-best score of 374 at the same venue in 2006.
The Old Boys' Association of Nalanda College, where Jayawardene studied, set up a special stand at the ground for his classmates, current students and the college band.
Left-handed Tharanga survived a difficult stumping chance when he was on 24 as a ball from Ajmal rose alarmingly and struck the wicket-keeper on the left ear.
Lahiru Thirimanne (20) was caught behind off Junaid, an over after being dropped in the slips off the same bowler.
Sri Lanka made two changes from the side that won the first Test to take the lead in the two-match series.
Left-arm seamer Chanaka Welegedara and batsman Thirimanne replaced the injured duo of Shaminda Eranga and Kithuruwan Vithanage.
Pakistan left out lanky fast bowler Mohammad Talha to play Riaz.