South Africa took control of the second Test against New Zealand thanks to Quinton De Kock and Temba Bavuma on Friday.
De Kock (91) and Bavuma (89) combined for a 160-run partnership after the tourists had been reduced to 94-6 at Basin Reserve in Wellington on day two.
Vernon Philander (36) and Morne Morkel (31) then frustrated the hosts to reach stumps with South Africa 349-9, a lead of 81.
New Zealand had dominated the opening session, their first-innings total of 268 appearing a good one.
But an aggressive De Kock and Bavuma punished some poor bowling to turn the Test back in South Africa's favour after lunch.
It came after the Black Caps had taken control thanks to Colin de Grandhomme (3-52), Neil Wagner (3-96) and Tim Southee (2-98).
South Africa resumed at 24-2 and nightwatchman Kagiso Rabada (9) went quickly on Friday.
JP Duminy's soft dismissal – flicking Wagner to Henry Nicholls at mid-wicket – for 16 gifted the hosts another wicket.
Hashim Amla (21) followed, picking out Nicholls, who took the catch on the second attempt, off de Grandhomme.
When wicketkeeper BJ Watling took a good catch after a Faf Du Plessis (22) inside edge off de Grandhomme, New Zealand were well on top.
Lunch on day two, great session for the boys. Four wickets taken for 80 runs. De Grandhomme 3-22. Saf 104-6, trail by 164 pic.twitter.com/OrxB31rDd7— BLACKCAPS (@BLACKCAPS) March 17, 2017
But the Black Caps bowled too short for periods after lunch, allowing De Kock and Bavuma to settle, the pair making 114 in the middle session.
The damage had been done when De Kock fell, caught behind pushing at a Jimmy Neesham (1-41) delivery.
Bavuma departed with South Africa already leading, while Keshav Maharaj (1) only lasted five balls.
Just as it looked like the Black Caps may face a tricky period before stumps, Philander and Morkel frustrated them.
The pair have put on 47 for the final wicket, Morkel having survived a tight lbw review.
The paceman was also struck on the helmet by Southee late in the day, one that belonged to South Africa after their poor start.