Brendon McCullum and Dean Brownlie hit half-centuries as New Zealand fought back on the second day of the first Test against South Africa at Newlands on Thursday.
New Zealand were 169 for four in their second innings at the close, still 133 short of avoiding an innings defeat. McCullum made 51 and Brownlie was undefeated on 69.
They were still likely to lose the match but it was a much better showing by the tourists after a calamitous first day during which they were bowled out for 45 and then leaked runs at almost four an over.
New Zealand's bowlers and fielders set the tone with an improved performance, restricting South Africa to 97 runs and claiming five wickets in 31.2 overs before South Africa declared at 347 for eight, a lead of 302.
AB de Villiers made 67 for South Africa before being dismissed shortly before the declaration. Trent Boult and Chris Martin both took three wickets for New Zealand.
Visions of the first day collapse were revived when Martin Guptill was dismissed by Dale Steyn in the first over of the second innings. But McCullum and Kane Williamson dug in to blunt South Africa's renowned pace attack, although they only added 29 before Williamson was caught at gully off Jacques Kallis.
The tempo changed after tea as McCullum and Brownlie counter-attacked, scoring 77 in the first ten overs after the interval as both Vernon Philander and Steyn took some punishment.
Both batsmen benefitted from fielding lapses. Brownlie was dropped at gully by Dean Elgar off Steyn when he had 23 and again one run later in the following over by Alviro Petersen, also at gully, off Philander.
Then McCullum, on 39, survived a sharp chance to Kallis at second slip off Steyn. The three dropped catches coming in successive overs.
McCullum made 51 before he played around his pads and was leg before wicket to left-arm spinner Robin Peterson, bowling for the first time in the match.
Brownlie took advantage of South Africa's attacking fields as he hurried to a half-century off just 44 balls, with eight fours but his scoring rate slowed down as he saw out the day.
He had faced 89 balls, batting for almost three hours, by the close. Brownlie was given out, caught down the legside by wicketkeeper AB de Villiers off Steyn when he had 68. He sought a review of umpire Rod Tucker's decision which proved the ball had not touched his bat.