Sri Lanka were making good progress towards a winning target of 270 at tea on the final day of the third Test against Pakistan.
At 1-0 down in the series, the tourists had earlier made a bold declaration on 380 for eight to leave their opponents 71 overs to seal victory.
The hosts made a positive start to their chase and were 132 for two after 37.2 overs, Dinesh Chandimal falling just before the break to give Pakistan hope. Kumar Sangakkara (35no) will lead the chase in what looks set to be an intriguing final session.
Asad Shafiq had earlier completed his second Test century. Shafiq, 55 not out overnight, reached exactly 100 as he and Adnan Akmal - batting bravely with a broken finger - added 81 runs without loss prior to the declaration.
Pakistan batted for 24.4 overs in the morning session, Shafiq facing 61 balls and taking 45 runs off them on what was still a reasonably benign pitch. That included four boundaries and plenty of positive running against a defensive Sri Lanka.
Akmal, who was scoreless at the start of the day, chipped in with 35no in 96 deliveries, standing firm and striking four fours of his own despite obvious discomfort. Pakistan skipper Misbah-ul-Haq called his batsmen in as soon as Shafiq nudged Rangana Herath for a single to bring up his second Test century.
That left Sri Lanka with 20 minutes to bat before lunch and the possibility of chasing a 2-0 series win.
They made an encouraging start, reaching 27 from five overs before the interval. Chandimal did the brunt of the scoring, with three boundaries in the last over of the session - bowled by Umar Gul - taking him to 14 not out in 13 balls. However Tharanga Paranavitana was first man out after the restart, caught by Younus Khan after making 22 in 38 balls.
Chandimal continued but found his run-rate slowed by some tight bowling from Saeed Ajmal, who was going at less than two an over. His 50 came up in 86 balls and included seven fours, but by the time he fed a catch to Shafiq off Ajmal's bowling he had just 15 more in 41 additional deliveries.
That dismissal came in the last over before tea and gave the fielding side a major boost. But with the class of Sangakkara going well at the other end and Mahela Jayawardene due in next, Sri Lanka still looked marginal favourites.