New Zealand captain Kane Williamson's 16th Test century left the first Test against South Africa evenly balanced at tea on day three in Dunedin on Friday.
New Zealand were 304 for eight, four runs behind South Africa's 308 and with only the injured Ross Taylor left to bat.
Williamson faced 241 deliveries for his 130 in a patient 380 minutes in the middle.
The Kiwi skipper fell an hour after lunch, ending an 84-run stand with BJ Watling who was dismissed two overs before tea for 50.
At the crease were Neil Wagner on four with Trent Boult yet to score.
Taylor, who left the field with a calf injury when on eight early in the New Zealand innings, will return to the crease if the team believes it necessary.
Williamson's century, which saw him draw level with Taylor on 16 -- one behind the late Martin Crowe's New Zealand record of 17 -- came on a hard-fought day of disputed decisions.
New Zealand scored 70 for the loss of two in the first session and could only manage 57 for three wickets in the second.
The crowd booed when the third umpire ruled Jimmy Neesham was out, caught behind for seven, when replays showed Morne Morkel had marginally overstepped the front line.
However, one camera angle was inconclusive and the benefit of the doubt went with the bowler.
Watling won an appeal to the third umpire after being lbw for three by spinner Keshav Maharaj.
To the naked eye the ball appeared to be heading towards the bails, but the ball tracker indicated it would have easily cleared the stumps.
When play resumed after lunch, South Africa delayed taking the new ball for nearly six overs, during which time New Zealand added 20 runs.
But when they did take the new ball, Kagiso Rabada used the extra pace and bounce to remove Williamson with a ball that seamed slightly to find the edge of the bat and wicketkeeper Quinton de Kock completed the dismissal.
In 11 Tests since taking over the captaincy, Williamson has an impressive average of 60.
It has been seven Tests since New Zealand last had a first-innings lead over South Africa.
The last time was in 2012, also at the University Oval, when New Zealand were ahead by 35 going into the second innings, with the Test drawn when the last day was washed out.
Rain is also forecast for the final day of this Test.