Pakistan will need to beat a world record target of 458 if it is to win the first Test against Pakistan in Colombo.
After Kumar Sangakkara hit 185, Sri Lanka declared its second innings at 448-5 and by stumps on day four, Pakistan was 88-2.
Imran Farhat and Younis Khan were the two batsmen dismissed.
Shoaib Malik (31) and Faisal Iqbal (77) will take up the challenge when play resumes on the fifth morning.
Sangakkara told BBC Sport that he believes Muttiah Muralitharan and Lasith Malinga will mop up the Pakistan innings for a Sri Lankan victory.
"They are still 370-odd runs behind and we just have to get a couple of key wickets to add on to the pressure we already have them under.
"As always, we'll be looking to Murali to do things for us, but we also have not seen much of Malinga yet and he could be dangerous on this pitch."
Sri Lanka gained its position of advantage thanks to a 158-run third wicket stand between Sangakkara and Mahela Jayawardene. Jayawardene, the Sri Lankan captain, was first out for 82, but Thilan Samaraweera merely added spice to the batting effort by helping add another 144 runs for the fourth wicket.
They were parted when Sangakkara was caught by Inzamam-ul-Haq from Shoaib Malik's bowling. Samaraweera hit 64 and was out just before the declaration.
All the Pakistan bowlers struggled with Mohammad Asif, the most successful with his 2-71.
Muralithan claimed both Pakistan wickets for 20 runs.