Kane Williamson's 16th Test century helped New Zealand as the first Test against South Africa remained in the balance after day three.
Williamson's ton helped the Black Caps to 341 at University Oval in Dunedin on Friday, a first-innings lead of 33.
The New Zealand captain is now behind only Martin Crowe (17) for most Test centuries for his nation.
His team also managed to remove Stephen Cook (0) before stumps, but Hashim Amla (23) and Dean Elgar (12) remained unbeaten as South Africa reached 38-1 – leading by five runs.
Bad light brought an early end to the day's play after a bizarre earlier incident led to the venue being fully evacuated.
An alarm in the main stand saw fans told to leave as a fire truck arrived, before play resumed less than 20 minutes later.
But neither team managed to take control of the match, despite Williamson's heroics and a maiden Test five-for for Keshav Maharaj.
South Africa bowled a tight line throughout the opening session, although nightwatchman Jeetan Patel (16) and Jimmy Neesham (7) were the only wickets to fall.
Neesham was perhaps unlucky, edging Morne Morkel (2-62) to Quinton De Kock, given out despite the paceman seemingly overstepping.
Patel was earlier removed by a brilliant catch, albeit at the second attempt, at slip by Faf Du Plessis, while Williamson struggled to get going despite bringing up his century.
#16— BLACKCAPS (@BLACKCAPS) March 9, 2017
316 mins pic.twitter.com/tgjC9nzgvm
Despite BJ Watling's 50 and Neil Wagner's run-a-ball 32, Maharaj (5-94) cleaned up the tail.
Despite his calf injury, Ross Taylor – who like Williamson has 16 Test centuries – returned to support Wagner for the 10th wicket.
The star batsman clearly struggled with his movement, but was unbeaten on 15 when Wagner departed chasing quick runs.
Cook fell off just the fourth ball of South Africa's second innings, caught behind by Watling off Trent Boult (1-6).
The opener walked, even though replays showed he likely missed the ball and instead hit his pad.
The evacuation caused a brief disruption before Amla and Elgar, facing spin due to the poor light, safely made it to the close of play.