A sensational double century from New Zealand captain Brendon McCullum helped his side towards safety in the second Test against India.
McCullum reached stumps on day four unbeaten on 281 - his highest Test score - with the skipper having shared world record stand for sixth wicket with BJ Watling.
McCullum had come to the crease on Sunday with New Zealand on 52-3 and on the brink of defeat, however his 525-ball knock meant the hosts will go into the final day on 571-6 - a lead of 325.
Watling and Jimmy Neesham also played key roles at Wellington's Basin Reserve.
Watling registered his highest Test score, with the wicketkeeper hitting 124 off 367 deliveries during a 352-run stand for the sixth wicket.
Neesham then added 67 not out, with the 23-year-old helping put on 125 for the seventh wicket.
New Zealand had started the day on 252-5 and needing something special to prevent India from levelling the series.
And the moments of magic came from their skipper as he defiantly resisted the Indian attack.
India captain MS Dhoni decided to test the patience of the Black Caps batsmen, having spent most of the last afternoon waiting for a mistake, to his own frustration.
Dhoni attacked for about half an hour on the fourth morning, and - at one point - he asked Ishant Sharma and Mohammed Shami to bowl from round the stumps with a seven-two off-side field.
But the only chance created with India still in the game was by Zaheer Khan, midway through the first session.
The tourists had to wait until deep into the final session before taking the wicket of Watling and it was Shami that trapped him lbw as ended the longest innings by a New Zealand wicketkeeper.
That brought Neesham to the crease but he piled on the misery, allowing New Zealand to take a comfortable lead into the final day.
"It's been a great day," McCullum said. "I'm a little bit tired, the body is a bit sore, but when you're scoring runs your body doesn't hurt so much.
"The last hour was a bit of a daze in all honesty and I was just trying to get through. Thankfully Neesh was playing some shots and ticking the board over because I was just hanging in there, if I'm brutally honest."