Continuing their World Test Championship final push, Sri Lanka have left New Zealand needing a record run chase in Christchurch, thanks in large part to a partnership between centurion Angelo Mathews and Dinesh Chandimal.
Putting on 105 throughout the middle of day four, Mathews (115) and Chandimal helped the tourists to a second-innings total of 302, setting New Zealand a target of 285 runs to chase.
Blair Tickner (4/100) and Matt Henry (3/71) were the pick of the bowlers for Kiwis. Tim Southee also got two wickets for 57 runs in 26.3 overs.
At 28/1 at the close of play, New Zealand, if they make the required runs, would complete the highest successful run chase in Test cricket at Hagley Oval, beating Australia's 201/3 in February 2016.
Despite a nervous half-hour in the early nineties, Mathews moved to his 14th test century with boundaries off back-to-back deliveries, swatting Blair Tickner through mid-wicket before booming a shot through covers off the back foot.
He spent much of the day with Dinesh Chandimal (42) who joined him in Sri Lanka's 5000-run club in Tests, doing so at an average of over 43, a better figure than six of other 10 to reach the mark.
Chandimal will be in touching distance of Arjuna Ranatunga's 5105 in the tenth when he takes the field in the second Test in Wellington on Friday, and would be one of three active Sri Lankan players in the top ten, with opener Dimuth Karunaratne (6090) also a vital cog in the line-up.
Sri Lanka began day four building a target-setting platform, adding 67 runs and only losing night-watchman Prabath Jayasuriya (6) in the morning session.
Mathews and Chandimal worked into their partnership, facing 218 balls between them, before the latter was bowled by a Tim Southee beauty after taking the new ball.
It brought Dhananjaya de Silva to the crease, whose smart acceleration moved Sri Lanka's lead past 250 in the evening session. His 47* included vital runs with the tail to move the team past 300, before Kasun Rajitha's wicket of Devon Conway (5) in the fifth over of New Zealand's reply meant the tourists made evening inroads with the ball. Tom Latham (11*) and Kane Williamson (7*) will resume on day five with the hosts needing a further 257 to win.
A win would keep Sri Lanka's hopes of a first World Test Championship final berth alive, though would also need victory in the second Test of the series, and for Australia to prevent an India win in the final Test of their series in Ahmedabad.
Earlier in their first innings, NZ was bundled out for 373 runs. Daryl Mitchell (102) hit his fifth Test century to help Kiwis reach such a big total. Matt Henry (72) and Tom Latham (67) also posted half-centuries. NZ gained a slender 18-run lead over SL.
Asitha Fernando (4/85) and Lahiru Kumara (3/76) impressed with the ball for Lanka and made sure that Kiwis' lead was not too massive. Kasun Rajitha got two wickets while Prabath Jayasuriya took one wicket.
SL scored 355 in their first innings before they ran out of batters. Kusal Mendis (87) and Dimuth Karunaratne (50) posted half-centuries for Lankan Lions. Angelo Mathews (47) and de Silva (46) also posted useful knocks.
Southee bagged a five-wicket haul, taking 5/64 in 26.4 overs. Matt Henry also took 4/80 and Michael Bracewell also took a wicket.
Brief Scores: NZ: 373 and 28/1 (Tom Latham 11*, Kane Williamson 7*, Kasun Rajitha 1/5) vs Sri Lanka: 355 and 302 (Angelo Mathews 115, Dhananjaya de Silva 47*, Blair Tickner 4/100).
READ ALSO: