Angelo Mathews celebrated with push-ups on the pitch after joining Kusal Mendis in passing 100 Tuesday as Sri Lanka batted the whole day without losing a wicket to give themselves hope of an unlikely first Test draw in Wellington.


Mendis was 116 not out at stumps on day four and Mathews 117, with their record-breaking unbroken 246-run partnership setting a Sri Lankan record against New Zealand.


It was also the first time in New Zealand that a full day's play has been completed without a Test wicket falling and the first time anywhere since South Africa achieved the feat against Bangladesh in Chittagong in 2008.


The pair's epic vigil meant the tourists ended the day at 259 for three after starting in a seemingly hopeless position with three wickets down for just 20 in their second innings after conceding a first-innings deficit of 296 to New Zealand.


Sri Lanka still need a further 37 to avoid an innings defeat but with a flat pitch offering nothing to New Zealand's seam attack and rain threatening on the final day, a draw is now a real prospect.


"Even tough it's a belter of a wicket, the concentration and commitment they had was unbelievable," bowling coach Rumesh Ratnayake said.


"We couldn't have asked for anything more."


New Zealand had hoped to wrap up the match early on the fourth day after posting an imposing 578 in the first innings, anchored by Tom Latham's unbeaten 264 -- which eclipsed former England captain Alastair Cook's 244 as the highest score by an opener carrying their bat in Test history.


But the home bowlers grew increasingly frustrated by the stubborn rearguard action, resorting to a barrage of bouncers that failed to rattle the batsmen.


Spinner Ajaz Patel said the Black Caps had not played poorly and were still upbeat about claiming victory on the final day.


"The positive thing for us is that we are the only team in a position to win the game. That's great position for us to be in," he said.


Mathews sent the New Zealanders a defiant message with his push-up celebration late in the final session that he still has plenty in the tank and is ready to bat on.


Mendis, who made only two in the first innings, was also pumped up, saying he would bat for another entire day if his team required it.


The 23-year-old initially took a positive approach and went after short-ball specialist Neil Wagner.


He blasted four boundaries off Wagner in an entertaining period that saw the paceman concede 35 runs in four overs before captain Kane Williamson ended his spell.


After the brief flourish with the bat, Mendis was content to put up the shutters and slow the scoring to a crawl.


"The plan was to bat out a lot of balls, rather than focus on run-scoring," he said through an interpreter.


Mathews, 31, who top-scored for Sri Lanka with 83 in the first innings, eked out his ninth Test century off 248 balls, while Mendis brought up his sixth Test ton off 215 deliveries.


The partnership will be a huge boost for Sri Lanka, who are ranked sixth in the world and have won only one Test in Wellington in five attempts.


They have also lost their last five Tests against New Zealand and suffered a 3-0 Test series whitewash against England last month.