Defence Force chief Lieutenant General Jerry Mateparae will retire by the end of the year to become the head of the Government's electronic spy agency.
He will take over at the Government Communications Security Bureau, which gathers international intelligence information and operates the Waihopai spy base, from February next year.
Prime Minister John Key says General Mataeparae has more than 38 years distinguished military service and has led the Defence Force admirably for the past four years.
Mr Key says the general will make a valuable contribution to the GCSB, New Zealand's security and defence and the country's international relations.
Defence Minister Wayne Mapp on Thursday paid tribute to General Mateparae, saying it has been a privilege working with someone who has provided exceptional leadership.
Dr Mapp says process to find General Mateparae's successor has begun and an appointment will be announced towards the end of this year.