Openers Abid Ali and Shan Masood put on a solid stand against the Sri Lankan attack in Karachi on Saturday as Pakistan took the lead in the second Test.
Abid was just seven away from his second hundred of the series, while Masood was 78 not out as they took Pakistan to 175 without loss at lunch on day three, batting on a dry pitch at the National Stadium.
Pakistan now lead by 95 runs, with the final and decisive Test in the two-match series in the balance. They had conceded an 80-run lead after Sri Lanka scored 271 in the first innings.
Abid and Masood were unperturbed after the hosts resumed the day at 57-0, putting on a record opening stand for Pakistan against Sri Lanka.
Abid, who became the first batsman ever to score hundreds on both Test and one-day international debuts with a century in the first Test, was in sublime form, hitting 13 fours and a six.
He survived a confident leg-before shout off paceman Lahiru Kumara on 61 but Sri Lanka lost the referral with the replays showing the ball would have missed the stumps.
Masood, playing his 19th Test, completed 1,000 Test runs and his seventh half-century. He hit two sixes and five boundaries.
The previous best Pakistan opening stand against Sri Lanka was 156 by Wajahatullah Wasti and Shahid Afridi at Lahore in 1999.
The current series — part of the ongoing World Test championship — is the first in Pakistan since a militant attack on the Sri Lankan team bus in 2009 which suspended international cricket in the country.