Veteran Kumar Sangakkara scored an unbeaten 140 as Sri Lanka made Pakistan's bowlers toil for wickets on the fourth day of the first Test in Galle on Saturday.
The hosts plodded from their overnight score of 252-2 to 338-3 by lunch, still trailing Pakistan's first innings total of 451 by 113 runs with seven wickets in hand.
With just 13 wickets having fallen so far on the slow pitch at the Galle International Stadium, the opening match of the two-Test series was heading towards a draw.
Sri Lanka lost a wicket off the day's third delivery when Mahela Jayawardene was adjudged leg-before to left-arm seamer Junaid Khan.
Umpire Ian Gould turned down a loud shout from the bowler, but Pakistan earned a positive verdict after appealing for a review from the third umpire. Replays showed the ball hitting the top of the off-stump.
Jaywardene, who is due to quit Test cricket after the series ends in Colombo later this month, made 59 in a third-wicket stand of 113 with Sangakkara.
Skipper Angelo Mathews denied the tourists another success before lunch, making 43 in an unbroken stand of 81 with Sangakkara.
Pakistan, which claimed the second new ball at the start, restricted Sri Lanka to 38 runs from 14 overs in the first 75 minutes of play, with Sangakkara contributing just 13 runs.
By lunch the unusually dour left-hander had added 38 runs to his overnight score of 102, frustrating Pakistan's bowlers on a wicket that offered them no assistance.
The 36-year-old Sangakkara had on Friday risen to fourth place in the list of century-makers with his 37th hundred, the seventh three-figure knock in his last 14 Tests.
Only the retired trio of India's Sachin Tendulkar, with 51 centuries, Jacques Kallis of South Africa, who had 45, and Ricky Ponting of Australia on 41, have scored more hundreds.
The second and final Test will be played on Jayawardene's home ground at the Sinhalese Sports Club in Colombo from August 14.