New Zealand troops began their withdrawal from Afghanistan Friday, with the lowering of the flag for the last time at their base in Bamiyan to mark the end of a 10-year involvement in the war.

The government announced the early withdrawal last year, with the New Zealand contingent originally scheduled to remain until September 2014.

Ten New Zealand soldiers have died in Afghanistan over the past decade -- eight in Bamiyan and two in Kabul.

New Zealand Governor-General and former defence chief Jerry Mateparae, who attended the closing ceremony, said earlier in the week before travelling to Afghanistan that it was the right time for troops to pull out.

"This has always been the case with us I think. We have gone in, done our job and then left. I think our job in Bamiyan is at about the right state," he said.

Defence Minister Jonathan Coleman said in Bamiyan that the 145 New Zealand troops working on provincial reconstruction had a significant impact on the region.

"The hospital has been rebuilt and new health centres have opened in all seven districts. Mortality rates for children have plummeted, and the same has happened to maternal death rates," he said.

"As we lower the flag today we are proud of what we have delivered in Bamiyan. Our influence on this province will endure and the sacrifices that have been made will be remembered."

Prime Minister John Key announced in February that a group of 27 troops would remain for about a year as part of New Zealand's commitment to the Nato-led operation in Afghanistan.