Sri Lanka declared on 5-480 in their second innings to give Pakistan a target of 302 to win on the final day of the first Test in Abu Dhabi on Saturday.
Angelo Mathews remained unbeaten on 157 while Prasanna Jayawardene was 63 not out after Sri Lanka resumed at 5-420.
Junaid Khan finished with 3-93 while Bilawal Bhatti took 2-146.
Pakistan have 67 overs to achieve the target or bat out for a draw.
In Karachi, in 1994, Pakistan successfully chased a target of 314 against Australia.