Pakistan's teenage fast-bowler Naseem Shah led the hosts' recovery against Sri Lanka on a riveting opening day as test cricket returned to the country on Wednesday for the first time since a militant attack in 2009.
Sri Lanka started strongly but Pakistan fought back through their four-pronged pace attack as the visitors reached 202 for five when bad light brought an end to the day's play.
Dhananjaya de Silva was unbeaten on 38 with Niroshan Dickwella 11 not out for the island nation.
The two-match series marks Pakistan's first tests on home soil since the attack on Sri Lanka's team bus in Lahore a decade ago and the current touring side have been promised watertight security during the visit.
In the presence of a small crowd at the Pindi Cricket Stadium, Sri Lanka captain Dimuth Karunaratne won the toss and opted to bat under overcast skies.
Karunaratne and his opening partner Oshada Fernando gave them a solid start, adding 96 for the first wicket as Pakistan's fast bowlers toiled through a wicketless first session.
The Sri Lanka captain was lucky to survive while batting on 31 when an inswinger from debutant Usman Shinwari kissed his off-stump but failed to dislodge the bails.
Shaheen Afridi gave Pakistan the first breakthrough when he dismissed Karunaratne, who was also hit on the back of the neck by Naseem Shah, leg before for 59.
Fernando, who played the last of his two tests in February against South Africa, fell to Naseem after a well-made 40.
The 16-year-old Naseem, who played his maiden test against Australia last month, also accounted for the experienced Angelo Mathews.
The former Sri Lanka captain scored 31 but added a crucial 62 for the fifth wicket with de Silva to steady Sri Lanka's innings after they had lost Kusal Mendis (10) and Dinesh Chandimal in quick succession to be reduced to 127-4.
Experienced middle-order batsman Chandimal was back in the Sri Lanka side for the first time since losing the captaincy after their defeat by Australia in Canberra in February but managed to score only two.
Sri Lanka included one frontline spinner in Dilruwan Perera, dropped opening batsman Lahiru Thirimanne and brought in Oshada.
Opening batsman Abid Ali was the other debutant for the hosts who dropped Imam-ul-Haq, while there was no place for experienced leg-spinner Yasir Shah.