Scott Robertson will succeed Ian Foster as head coach of the All Blacks after this year's Rugby World Cup, New Zealand Rugby (NZR) confirmed on Tuesday.

Appointed on a four-year deal, Robertson's contract will see him through to the end of the 2027 World Cup in Australia.

"It’s an honour to be named as the next All Blacks Head Coach,” Canterbury Crusaders coach Robertson said in a statement. "It’s a job that comes with a huge amount of responsibility, but I’m excited by the opportunity to make a contribution to the legacy of the black jersey.

"To represent your country, as a coach or player, is the ultimate honour in sport and it’s humbling to be given that opportunity. I can’t wait."

Robertson had been vying with Japan head coach Jamie Joseph for the role.

He lost out to Foster for the job when Steve Hansen stood down after the 2019 World Cup in Japan but his sustained success at the Crusaders in Super Rugby generated plenty of interest in his services overseas.

"We were very happy with the caliber and quality of the people involved and would like to thank all of those who took part in the process," said NZR Board Chair Patsy Reddy.

"The decision to appoint the next All Blacks head coach ahead of the Rugby World Cup was not taken lightly, but we believe it was the right decision for New Zealand Rugby and the All Blacks and will set the team up for future success."

The World Cup will be held in France from Sept. 8 to Oct. 28.