Seasoned batsmen Younis Khan and Misbah-ul Haq hit resolute half-centuries to take the fight to Sri Lanka in the second Test in Dubai on Friday.
Younis was unbeaten on 62 and Misbah scored 52 not out to help Pakistan reach 132-2 at close on the third day at the Dubai stadium pitch which is likely to help spinners on the last two days.
Pakistan still need another 91 runs to avoid an innings defeat and go 1-0 down in the three Test series after the first Test ended in a draw in Abu Dhabi.
Younis and Misbah -- who both hit hundreds in Abu Dhabi last week, came together with Pakistan in dire straits at 19-3. They held the batting together during their unfinished 113-run fourth wicket stand.
Sri Lanka earlier gained a big 223-run lead by scoring 388 in their first knock. Pakistan had made 165 in the first innings.
Younis said the fightback will continue.
"It's nice to fight back," said Younis. "I had a good partnership with Misbah when the team needed it and our first target on Saturday will be to erase the lead and then bat on."
It was paceman Nuwan Pradeep (2-28) who gave Pakistan early wobbles.
Pradeep, who took a career best 3-62 in the first innings, had Mohammad Hafeez (one) caught behind in his second over and in his fourth swung one across Manzoor (six) for wicketkeeper Prasanna Jayawardene to take his seventh catch of the match.
Pakistan had lost opener Ahmed Shehzad in the last over before lunch, caught behind for nine off spinner Rangana Herath.
It was left to Younis and Misbah to fight one more time for Pakistan.
Younis was more cautious, reaching his 28th half-century with a single off Herath and continued to bat solidly during his 142-ball stay, hitting four boundaries.
Misbah completed his 3,000th Test run when on 10, becoming Pakistan's 15th batsmen to achieve the milestone. The Pakistan captain survived one leg-before referral on one and twice on close catches behind the wicket, once off a miscued hook which went to the boundary.
But in another responsible batting display he reached his fifty with a double off Herath. He has so far hit five fours and a six during his 119-ball stay.
Sri Lankan coach Graham Ford hoped Sri Lanka break through early on Saturday.
"They (Younis and Misbah) are class batsmen," said Ford. "We would love to get them early on fourth day."
Earlier, Mahela Jayawardene hit a fighting 129 and when on 117 became the eighth highest run-getter in all Test cricket, surpassing Australia's Steve Waugh's 10,927 in 140 Tests. Jayawardene now has 10,940 in 140 Tests.
India's now retired Sachin Tendulkar leads the chart with 15,921 in a remarkable 200 Tests.
Resuming at 318-4, Sri Lanka lost skipper Angelo Mathews, caught behind by wicketkeeper Sarfraz Ahmed off paceman Rahat Ali without adding to his overnight score of 42.
Mathews, man of the match in Abu Dhabi for his 91 and 157 not out, hit five boundaries during his 88-ball knock.
Jayawardene's brilliant knock ended when he was bowled out while trying to reverse sweep Saeed Ajmal after scoring 129. Jayawardene batted resolutely for 423 minutes and hit 15 boundaries in an innings which gave Sri Lanka the crucial lead.
Ajmal's first wicket came in his 29th over and he took one more in the end to finish with 2-56 in 34 overs. He went wicketless in 49 second innings over in Abu Dhabi.
Left-arm paceman Junaid Khan finished with the best figures of 3-102 while Ali took 2-131 in 36 overs.