Sri Lanka put itself in a strong position to win the first Test against New Zealand as its run chase began with an unbroken century stand.
Set 268 for victory in Galle, Sri Lanka was handsomely placed on 133-0 when fading light stopped play late on Day four.
Dimuth Karunaratne reached 71 not out and Lahiru Thirimanne was undefeated on 57, in what was already a record first-wicket partnership for Sri Lanka in the fourth innings of a Test.
New Zealand, who sit second in the ICC Test rankings, stretched its overnight lead of 177 to 267, with B.J. Watling adding 14 to his overnight score before being caught behind for 77 by Niroshan Dickwella off Lahiru Kumara.
William Somerville made an unbeaten 40, with Trent Boult cracking a rapid 26 and last man Ajaz Patel weighing in with 14, the lower-order batting success in the innings of 285 all out suggesting it was a wicket ripe for scoring on Saturday.
That was how it continued to look as Sri Lanka began chasing down the target, although Tim Southee and Trent Boult gave Karunaratne and Thirimanne cause for early worry.
Thirimanne was well beaten by a ball from Southee that narrowly cleared off stump, before moments later Karunaratne almost nicked a delicious delivery from Boult.
It was often Karunaratne who was riding his luck, and it was not until the 22nd over that Sri Lanka, ranked sixth among Test nations, registered a boundary.
Later, Watling could not cling to a difficult chance as Karunaratne got a bottom edge off Somerville, the ball going through the wicketkeeper to bring up the two runs that took him to a half-century.
Tom Latham at short leg missed out on a sharp chance as Karunaratne used up another life, and the same batsman was fortunate not to be stumped by Watling in the next over.
Somerville, a 35-year-old off-spinner playing just his second Test match, took three first-innings wickets and was unlucky to gain no further reward as Sri Lanka edged towards the target in the gathering gloom.