Mahela Jayawardene fell cheaply in his final test as Pakistan came back strongly in the last session to grab five wickets and reduce Sri Lanka to 261 for eight on the first day of the second test on Thursday (local time).
Dhammika Prasad was unbeaten on four at the close after captain Angelo Mathews was dismissed for 39 in the final over of the day when he was caught down the leg side off Wahab Riaz.
Left-arm fast bowler Junaid Khan took three of the four wickets to fall in the session and ended the day with figures of four for 69.
"There wasn't much in the pitch but if you bowl in good areas and work hard then you can get something out of it," Junaid told reporters.
"If you bowl bad balls in bad areas you can score as well.
"From one end Wahab bowled with pace and bounce which made the batsmen scared and he was bowling with swing and at the stumps and it worked very well for Pakistan."
There was great expectation from the spectators who had turned up to see former captain Jayawardene play in his 149th test, but the elegant 37-year-old lasted just 16 balls and made four runs before he was trapped lbw by Saeed Ajmal in the first over after tea.
Pakistan also grabbed the wicket of opener Upul Tharanga when he flicked a ball from Riaz and the inside edge that came off his pad was held smartly by Azhar Ali at short leg after a fumble.
Tharanga scored 92 off 179 balls including 12 fours.
"We need to get as many runs as possible tomorrow, because first innings runs are crucial on a track that is turning from the first day," Tharanga said.
"That will go a long way towards determining the outcome of the match.
"If we get a few wickets, our bowlers can put them under pressure. You can't score runs freely, like SSC tracks of the past."
The final session was Pakistan's most fruitful for they took four wickets including that of Lahiru Thirimanne for 20, Niroshan Dickwella for 24 and Dilruwan Perera for a duck.
Thirimanne edged Junaid to Sarfraz after being missed on 14 by Khurram Manzoor at first slip.
Dickwella and Perera were lbw victims to the second new ball.
Dickwella unsuccessfully challenged the umpire's decision and lost a review for his team but Pakistan were successful with Perera's dismissal which the umpire had initially ruled not out.
Kumar Sangakkara, the most prolific scorer in the series so far, had a testing time against Wahab Riaz before he was bowled off an inside edge for just 22.
Riaz peppered Sangakkara, who scored a double century in the first test, with short-pitched balls which momentarily shook his confidence and eventually led to his downfall.
As Sangakkara departed, Jayawardene walked out to a standing ovation and the Pakistan players formed a guard of honour as fire-crackers exploded around the packed Sinhalese Sports Club ground.
Sri Lanka, who won the first test by seven wickets, had batted cautiously to reach 69 without loss at lunch after winning the toss.
What do you make of the recent crackdown on chucking in cricket?