Sri Lanka's captain Kumar Sangakkara hit an unbeaten century to dim Pakistan's hopes of securing a face-saving win in the third and final cricket Test in Colombo on Friday.
The left-hander was 111 not out as Sri Lanka, faced with a world record target of 492 to sweep the series 3-0, moved to 338-4 by tea on the fifth day at the Sinhalese sports club.
The rock solid Sangakarra's 19th Test century featured a fourth-wicket stand of 122 with Thilan Samaraweera (73) and 61 for the unbroken fifth with Angelo Mathews (33 not out).
The two teams go into the final session of the match with Sri Lanka needing 154 runs from a possible 38 overs to record a record-breaking win and Pakistan requiring six wickets.
No team has achieved this high a target in the fourth innings to win a Test match. The highest successful chase so far is 418-7 by the West Indies against Australia in Antigua in 2003.
The hosts appeared in no hurry to force a victory after scoring 76 runs from 26 overs in the post-lunch session.
Sangakkara and Samaraweera, who resumed the day at 183-3, batted through the morning session to take Sri Lanka to 262 without further loss by lunch.
Sri Lanka suffered a setback soon after lunch when Samaraweera strained a hamstring while taking a single and called for a runner.