Gritty half-centuries from Ahmed Shehzad and Azhar Ali steered Pakistan to 171 for two against Sri Lanka when bad light ended the third day of the second Test, still six runs behind the hosts.
Shehzad fell for 69 to the first ball after tea having shared a 120-run second-wicket partnership with Ali (64) who was unbeaten after registering his 20th test fifty.
Sri Lanka batsman Kumar Sangakkara will quit international cricket after the second Test against India in August.
Sangakkara, who has scored more than 26,500 runs for his country, had already retired from ODIs and T20Is, is currently playing his 132nd Test.
"This is my time to call it a day," he said.
Veteran Younis Khan was on 23 not out at stumps.
Earlier, Pakistan had claimed the last Sri Lankan wicket in the morning session to bowl out the hosts for 315 with leg-spinner Yasir Shah (6-96) dismissing Dushmantha Chameera 15 minutes after a rain-delayed start.
Younis held a good running catch to send back Chameera as Sri Lanka, pressing for a series-levelling victory, took a 177-run first-innings lead.
Shot out for 138 in their first-innings, Pakistan did not make a great start in their second either as a leaden-footed Mohammad Hafeez (eight) poked at an Angelo Mathews delivery to be caught by Kumar Sangakkara in the slips.
Shehzad and Ali proved there were no demons in the pitch and they frequently used their feet to negate the threat posed by Sri Lanka's left-arm spinner Rangana Herath.
Shehzad overcame a blow on his helmet by a Chameera bouncer to bring up his fifty in the 35th over.
The opener, however, perished straight after tea when he edged a pull shot against Dhammika Prasad through to keeper Dinesh Chandimal.
Younis and Ali, however, ensured Pakistan did not suffer any more setbacks as play ended early due to bad light.
Source: Al Jazeera and agencies