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.
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.
Also Read
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.
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.