Now, extremist Islamic group the Taliban has reacted to the decision.
"New Zealand's move to withdraw its troops from Afghanistan under the Doha Accords is welcome," Taliban spokesman Zabihullah Mujahed said in a statement posted on Twitter.
"We call on all countries to do the same for their country's troops in Afghanistan's long and unwinnable war."
Washington agreed to withdraw all US forces last year in exchange for security guarantees with the Taliban.
But President Joe Biden's new administration has said it will review the deal after a recent surge in violence, with at least 11 Afghan human rights defenders and journalists having been killed in the past five months, according to the UN Assistance Mission in Afghanistan.
New Zealand's current deployment totals just six NZDF personnel – three at the Afghanistan National Army Office Academy and three with the Nato Resolute Support Mission Headquarters – and will be pulled out by May.
But over the past 20 years, 3500 New Zealand troops and officials have been deployed there in a conflict which began after the September 11 terrorist attack on the Twin Towers in New York.
The attack was organised by Al Qaeda, which was thought to have operated from Afghanistan.
Ardern yesterday said the decision to withdraw had been discussed with New Zealand's key partners.
"The deployments to Afghanistan have been one of the longest-running in our history, and I wish to acknowledge the 10 New Zealanders who lost their lives in the line of duty, and the more than 3500 NZDF and other agency personnel whose commitment to replace conflict with peace will always be remembered," she said.
Foreign Affairs Minister Nanaia Mahuta said that although the environment remained complex, the intra-Afghan peace process affords Afghanistan the best prospect of an enduring political solution.
"New Zealand will continue to be supportive of the Afghan government and its people in the years to come, including as they work through the intra-Afghan peace process in an effort to resolve the decades-long conflict."
New Zealand deployed the SAS in 2001 and Willie Apiata later won the Victoria Cross.
The biggest deployment occurred when New Zealand led a Provincial Reconstruction Team in Bamiyan province.
Lieutenant Tim O'Donnell was the first NZDF death in Afghanistan in August 2010 when a patrol he was part of came under attack by insurgents near Bamiyan.
A subsequent operation to attack the insurgents, known as Operation Burnham, became the subject of a book, Hit and Run, by Nicky Hager and Jon Stephenson, alleging a cover-up over civilian casualties.
A commission of inquiry headed by former Prime Minister Sir Geoffrey Palmer and former Supreme Court judge Sir Terence Arnold was highly critical of the NZDF but found that the operation in which there were civilian casualties had been justified under international law.
NZDF's contribution to Afghanistan
• Ten soldiers died in Afghanistan: Lieutenant Tim O'Donnell; Private Kirifi Mila, Corporal Douglas Hughes, Lance Corporal Pralli Durrer, Lance Corporal Rory Malone, Corporal Luke Tamatea, Lance Corporal Jacinda Baker and Private Richard Harris all died in Bamiyan Province. Corporal Douglas Grant and Lance Corporal Leon Smith from NZSAS died in Kabul. • More than 3500 NZDF personnel deployed to Afghanistan, mainly based in Bamiyan, between late 2001 and 2013. • Four separate NZ SAS deployments. • NZDF spent around $300 million during its commitment in Afghanistan.