The New Zealand flag has been lowered for the final time at Kiwi Base in Bamiyan, the symbolic end to New Zealand's 10-year involvement in the war in Afghanistan.
Afghan authorities will now have sole responsibility for development and security in the province, whose future is still uncertain.
The 160 or so members of New Zealand's Provincial Reconstruction Team (PRT) were joined by soldiers from Malaysia and the United States, also stationed at Kiwi Base, in saluting as the flag was lowered on a chilly evening in Bamiyan.
Afghan and New Zealand dignitaries spoke of the PRT's contribution to the safety and development in the region, and of the sacrifice made by the 10 Kiwi soldiers who died in Afghanistan.
New Zealand's Governor-General Sir Jerry Mateparae said he was confident the Afghan people would continue to improve the region, and said New Zealanders should be proud of those who had served there.
"They came here knowing the risks that service here entailed, and the dangers that claimed 10 young lives.
"They came here because they were proud to follow in the footsteps of other New Zealanders who have left our shores to resist tyranny, to defend democratic values, and to bring peace to troubled lands."
Bamiyan Provincial Governor Habibi Sorabi expressed her gratitude to New Zealand for its contribution, which she said would never be forgotten.
"The Bamiyan local authorities and the community are grateful for the generous and the humanitarian support and presence of the New Zealand [sic] in the last 10 years and consider those supports very effective.
"Support in the fields of security, good governance, tourism development, education and health sectors and infrastructure have changed the face of Bamiyan."
Defence Minister Jonathan Coleman said the PRT's achievements in Bamiyan were "very real".
"New Zealanders arrived in Bamiyan in 2003 under a UN mandate to a province which had been shattered - hospitals and schools had been destroyed, women and girls suffered appalling treatment under the Taliban and families had fled to the relative safety of the hills.
"Now we can look around and see the impact that the PRT has made in this 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.
"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."
He said the thing that gave New Zealanders the greatest pride was the huge improvements made to the lives of women and children.
"At the time of the Taliban, no girls received any education in Bamiyan. Now almost half the children of Bamiyan's primary schools are girls, 38 per cent of teachers are female, and there are 2700 students at Bamiyan University, 15 per cent of whom are females."
Dr Coleman also paid tribute to Dr Sorabi for her "inspirational leadership".
International Security Assistance Force (ISAF) deputy Nato senior civilian representative Andrew Steinfeld said the New Zealand-led Bamiyan PRT had served as "a remarkable example of cooperation and effectiveness".
"This small team of approximately 250 personnel from New Zealand, the United States and Malaysia, working in close cooperation with the Afghan National Forces, have achieved remarkable results."
About 3500 New Zealanders have served in Bamiyan over the past 10 years. All the troops are due to leave by the end of the month.