Dean Elgar, helped by untidy New Zealand fielding, was on the verge of his seventh century as he rescued South Africa from an early slump in the first Test on Wednesday.
After the morning belonged to New Zealand when they took three quick wickets, Elgar took charge in a fertile 126-run stand with Faf du Plessis to steer South Africa to 153 for four at tea on day one in Dunedin.
Elgar was not out 92 in a patient 185-ball stay in the middle, with Temba Bavuma yet to score.
Jimmy Neesham snared the wicket of du Plessis, caught in the deep by Trent Boult, three overs before the break for 52.
New Zealand aided South Africa's cause when Elgar, on 36, was dropped down the legside by wicketkeeper BJ Watling off the first ball he faced after lunch and du Plessis on 18 offered a hard chance to Tom Latham at short leg which was not taken.
Both batsmen were then in danger of being run out when taking a quick single but Neil Wagner fumbled the ball and they safely made their ground.
When du Plessis opted to bat first, snapping a run of 22 Tests in New Zealand where the captain who won the toss bowled, he initially had reason to wonder if he had been wise to ignore history.
Trent Boult trapped Stephen Cook plumb in front while Wagner removed Hashim Amla and JP Duminy in the space of five deliveries.
Wagner, returning to top-level cricket after breaking a finger in his bowling hand five weeks ago, bowled Amla with a full delivery and then went short to Duminy who was caught off the gloves by Ross Taylor.
South Africa were in trouble at 22 for three when du Plessis joined Elgar to mount their rescue mission.
With the pitch more brown than green and offering variable bounce and turn, there was the rare sight in New Zealand of spin introduced early when Jeetan Patel came into the attack in the sixth over.
The off-spinner's inclusion along with the left-arm Mitchell Santner gave New Zealand two spinners in a home Test for the first time in seven years and meant the dropping of regular bowling spearhead Tim Southee.
New Zealand have won two home series this summer, beating Pakistan and Bangladesh 2-0, but have never won a series against South Africa.