Ian Foster will coach the All Blacks through to next year's World Cup, New Zealand Rugby said on Wednesday, giving him a vote of confidence despite recent poor performances.
A relieved-looking Foster thanked the board and CEO Mark Robinson for their "strong support" after a meeting to decide his fate.
"It's a privilege to be in this job, it's never something you take for granted," Foster said.
The 57-year-old stays in charge for the All Blacks' next home Test, against Argentina in Christchurch on August 27, and will coach New Zealand at the Rugby World Cup in France in September 2023.
Foster will receive extra support with former Ireland boss Joe Schmidt coaching the attack, having been a New Zealand selector.
"Joe Schmidt has been on my radar for a couple of years," said Foster.
"We've decided to move him from the computer room to put him on the park a bit more."
Stewart Mitchell, chairman of New Zealand Rugby, said the board had faith in Foster despite the All Blacks losing three of five Test matches so far this year, triggering calls from fans and media for him to be sacked.
"I want to absolutely emphasise that both Ian Foster as head coach and Mark as CEO has full support from the board," said Mitchell.
Foster had been under fierce pressure after back-to-back home defeats to Ireland last month, followed by a heavy loss to South Africa.
"It's clearly been a difficult time, the start of the campaign we didn't get what we wanted against Ireland and that created a lot of performance stress," Foster said.
Even after the All Blacks bounced back last Saturday with a stunning 35-23 win over the Springboks in the second Test in Johannesburg, New Zealand Rugby boss Robinson had refused to publicly back Foster.
The All Blacks coach rejected a reporter's suggestion that he had been "hung out to dry".
"In some ways that is part of the job and it's part of Robo [Robinson] and Stew's [Mitchell] job as well to critique me," said Foster.
"I'd rather it wasn't there, but we live in the real world and we're under pressure to perform. I don't mind that."
Foster already had the backing of senior All Blacks Ardie Savea and captain Sam Cane after Saturday's win.
Last week, former All Blacks winger Julian Savea used Instagram to say he was "shocked and disturbed at some of the remarks about Ian Foster on social media lately".
Robinson admitted the last few weeks could have been handled better.
"We are trying our best for our sport and our people. Sure, we never get everything right, but at no stage do we ever not do what's best for our people," he said.
There had also been calls in the New Zealand media for Robinson to stand down, but he insisted the All Blacks camp was united.
"The developments and changes we've seen and some of the tweaks Foster (has made are) something we're really excited about," he said.
"We believe - from board level, executive and player group - we're all behind this together."