Younis Khan and Asad Shafiq defied Sri Lanka during a fifth-wicket stand of 151 as Pakistan fought for survival in the first Test in Galle on Monday.
The tourists, set a near impossible victory target of 510, carried their second innings from the overnight score of 3-36 to 5-205 by tea on the fourth day.
Younis, 34, the most experienced batsman in the Pakistan side with 77 Test appearances, held the innings together with an unbeaten 81, his 26th half-century in the five-day format.
Shafiq, a 26-year-old playing his 14th Test, matched his senior partner with a fluent 80 that contained 13 hits to the fence.
But just when the duo appeared to have survived the entire afternoon session, Shafiq was dismissed against the run of play, edging left-arm spinner Rangana Herath to Mahela Jayawardene in the slips.
Mohammad Ayub, a 32-year-old debutant, was the other batsman at the crease on five.
The partnership between Younis and Shafiq, who came together in the day’s second over at 4-38, helped Pakistan salvage their reputation after the tourists were shot out for 100 in the first innings.
But Sri Lanka remain strong favourites to wrap up the game and take the lead in the three-Test series despite forecasts for rain interruptions till Tuesday evening.
Pakistan lost nightwatchman Saeed Ajmal in the day’s second over, run out by a direct throw from the covers by Suraj Randiv.
Younis earned a reprieve on nine when Tillakaratne Dilshan picked up a low catch at mid-off, but television replays proved inconclusive whether the catch had been taken cleanly.
Shafiq was the first to reach his half-century by flicking Nuwan Kulasekara to the fine-leg fence for his sixth boundary.
Younis followed six overs later with a single off Randiv, his 50 receiving warm applause from the Pakistan dressing room.
Kulasekara and Herath have taken two wicket each, with the second new ball available to Sri Lanka after one over.