Pakistan's opener Abid Ali is nine runs from becoming the first batsman to score hundreds on Test and one-day international debut, as the first Test in Pakistan since the 2009 attacks heads for a draw.
The 32-year-old was unbeaten on 91 along with Babar Azam on 47 as Pakistan reached 177-2 at tea in reply to Sri Lanka's first innings total of 308-6 on the fifth day at Rawalpindi stadium.
Abid scored 112 against Australia in Dubai on his one-day international debut in March this year.
Bad weather hit the Test on all previous four days and only 91.5 overs were played as rain, bad light and overcast conditions affected the game. The fourth day was abandoned without a ball being bowled.
But there was bright sunshine on Sunday as Sri Lanka batted for 20 minutes to declare their first innings at 308-6 with middle-order batsman Dhananjaya de Silva scoring an unbeaten 102.
With gates opened to the crowd for free, about 12,000 fans were kept entertained by Dhananjaya and then Abid.
More From This Section
Pakistan lost opener Shan Masood for nought when he drove a full toss from pacer Kasun Rajitha straight into the hands of Dinesh Chandimal at cover, while skipper Azhar Ali scored a shaky 36 before he was caught off paceman Lahiru Kumara.
Dhananjaya finally completed his sixth Test century in the morning.
The 28-year-old right-hander drove paceman Mohammad Abbas for his 15th boundary to bring up the hundred in his 28th Test.
De Silva remained unbeaten on 102 after 241 minutes of batting, having come in with the score on 127-4 on Thursday. Dilruwan Perera remained unbeaten on 16.
The pick of the Pakistan bowlers were 16-year-old pace bowler Naseem Shah, who took 2-92, and Shaheen Shah Afridi with 2-58.
The Test is the first in Pakistan since a militant attack on the Sri Lankan team bus killed eight people in March 2009, leading to the suspension of international cricket in the country as foreign teams refused to visit over security fears.
The second Test is in Karachi from December 19.