Kane Williamson has led a New Zealand fightback against South Africa to leave the first Test in Dunedin delicately poised at the end of the second day.
The tourists lost their last six wickets for 56 runs to be dismissed for 308, before the hosts ended the day on 117-3 thanks to a battling unbeaten 78 by Williamson.
South Africa started the day in a strong position at 229-4, with Dean Elgar unbeaten on 128 and Temba Bavuma on 38.
However, they were bowled out shortly after lunch when Trent Boult (4-64) dismissed Vernon Philander for 21 to pick up his fourth wicket of the innings.
In reply, the Proteas removed Tom Latham early, caught behind off Philander for 10, but New Zealand were 59-1 at tea.
Williamson and Jeet Raval sparked the innings with a 102-run stand, a record second-wicket partnership for New Zealand against South Africa, before Raval went for 52.
Ross Taylor then limped from the field with a calf injury after making eight from 20 balls, having earlier been struck on the helmet by fast bowler Morne Morkel.
However skipper Williamson held firm, hitting 11 boundaries from 146 balls, to give his team a slight advantage going into day three.