A record seventh-wicket partnership between Thilan Samaraweera and Suraj Randiv helped Sri Lanka to avoid the follow on against New Zealand on the third day of the second test at P. Sara Oval on Tuesday.
But Sri Lanka, after reaching 225-6 when stumps was called early for bad light, still trailed the tourists by 187 runs on the first innings. New Zealand made 412.
Middle-order batsman Samaraweera was unbeaten on 76, and Randiv not out on 34 for his best score in test cricket.
Together they have shared 97, a record for the seventh wicket at P. Sara Oval, improving on the 80-run stand between Mahela Jayawardene and Prasanna Jayawardene in a win against India in 2008.
Samaraweera came in when Angelo Mathews fell in the morning on 103-5 and showed no discomfort despite batting with a split webbing between his middle and ring fingers on his right hand. He faced 156 balls and hit five fours so far in his 30th half century.
New Zealand opted for the second new ball soon after it was available, but the batsmen survived the brief spell before Kiwis captain Ross Taylor was forced to bring on the spin bowlers due to the deteriorating light.
Sri Lanka avoided the follow on when Samaraweera scored a boundary off an edge that flew over the slip cordon off the bowling of Trent Boult.
Play was suspended 90 minutes before scheduled due to bad light.
Earlier, Tim Southee picked up both overnight batsmen in the morning session after Sri Lanka resumed on 43-3.
Opener Tharanga Paranavithana, after more than three hours at the crease, was caught behind for 40 off 112 balls at 102-4. He'd been dropped in the slips by Taylor on 32.
Mathews went two overs later for 47, just before lunch, when he edged to the slips and Martin Guptill took a great one-handed diving catch.
Wicketkeeper Prasanna Jayawardene came in and barely survived a stumping off his second ball faced. He was the last wicket to go, after lunch at 128-6, caught in the deep when he top edged an attempted sweep off spinner Jeetan Patel on 12.
Southee was 4-51 by day's end.
Sri Lanka lead the two match series 1-0 following its ten wicket win in Galle.