The Government announced its commitment to protecting New Zealand's "legacy" in Afghanistan as it confirmed the "sensible, orderly and professional" early withdrawal of troops.
The New Zealand Provincial Reconstruction Team (PRT) will be back from Bamiyan Province by the end of next April, leaving local forces in charge of security.
Defence Minister Jonathan Coleman said the announcement was a "milestone" after 10 years of involvement in Afghanistan.
"Over its 10-year deployment, the New Zealand PRT had contributed to international counter-terrorism efforts, improved security and the development and governance of Bamiyan province," said Dr Coleman.
"Our success is reflected in Bamiyan's position as a leader in the transition process."
There were calls to withdraw New Zealand troops early after five died in two separate incidents in August. Five Australian troops were killed last week.
Dr Coleman said the withdrawal was brought forward by news the rebuilding of Bamiyan airport would make it off-limits to New Zealand's Hercules aircraft after April.
He said New Zealand would continue to support Afghanistan to ensure progress by the international community was sustained.
"New Zealand's legacy in Afghanistan depends on this," he said.
Future support was likely to include sending a small number of Defence Force trainers to the Afghanistan National Army Officer Training Academy later in 2013.
Prime Minister John Key has been signalling the early withdrawal from Afghanistan but a formal decision had to be signed off by Cabinet.
Originally New Zealand troops were set to withdraw by September 2014, but Mr Key said the Government had been encouraged to bring that forward by the International Security Assistance Force.
Eleven of the 26 original reconstruction teams sent to Afghanistan would leave by the end of 2013, he said.
"ISAF's view has been it's not sensible for everyone to go through the keyhole at one time."
Mr Key said New Zealand troops had made a significant difference in Bamiyan, helping children to go to school, improving hospital services and supporting the economy.
Labour Party leader David Shearer said he was pleased with the early withdrawal.
"Our soldiers have achieved remarkable results during the nine years that we have been on the ground in Afghanistan.
"Staying there any longer would not have made a significant difference to all we have achieved. There is a time to leave and this is it."
Green Party defence spokesman Kennedy Graham said the Government should withdraw the PRT now.
"New Zealand has made a significant commitment to Afghanistan and the people of Bamiyan - however the PRT was never intended to be a combat unit," Mr Graham said.
"Sadly, the role of those serving in the provincial reconstruction team now appears to be focused more and more on patrolling a dangerous part of Bamiyan province, where our troops are being drawn into counter insurgency operations."