Plans are being made to bring the bodies of two New Zealand soldiers home from Afghanistan.
Six others were injured when they went to the aid of Afghan security forces who were under attack from insurgents in Bamyan Province.
Defence Force chief Rhys Jones says New Zealand forces were asked to help an Afghan police group that had been ambushed while trying to arrest a suspected insurgent in Bamyan province.
Soldiers from the Provincial Reconstruction Team suppressed the attacking insurgents but were then ambushed themselves by a second group, near a village south of Do Abe, at 7pm on Saturday.
Lieutenant-General Jones says the insurgents used anti-tank weapons to attack the New Zealanders' armoured vehicles. They then fired at the soldiers on the ground with rifles and machineguns, causing the casualties within two or three minutes.
Lt-Gen Jones says thesix wounded soldiers suffered gunshot and shrapnel wounds and have been evacuated to two different military hospitals in the north of Afghanistan.
He says they've all been in contact with their next of kin in New Zealand. Three are in a serious but stable condition; the others suffered moderate injuries.
Two local security personnel were also killed and 11 others wounded.
The Defence Force says it will release no names for 24 hours, out of consideration for the families involved.
The United States and Australia have offered to help transport the bodies of the two dead soldiers home, and this will happen sometime this week.
The deaths bring to seven the number of Defence Force personnel killed while serving in Afghanistan.
New Zealand forces have been deployed in the country since 2003 and there are currently 149 Defence Force personnel in Bamyan province.
Leaders saddened by loss
Prime Minister John Key has expressed his sadness at the deaths and injuries. He says the incident reinforces the danger faced daily by New Zealand's forces in Afghanistan, and his thoughts are with the families and friends of those killed and wounded.
"I'd like to reassure their families that they'll always be remembered by all New Zealanders for the sacrifice that they've made to restore stability to the region," Mr Key told a news conference at Whenuapai air-force base on Sunday.
Defence Minister Jonathan Coleman says the thoughts of the Government and the people of New Zealand are with the Defence Force today, and especially the families of those who died or were wounded.
Labour Party leader David Shearer told TV1 the deaths are saddening in light of the good work being done by the reconstruction team.
Mr Key says that, as previously announced, the Provincial Reconstruction Team will be withdrawn in 2013.
Australia's acting Prime Minister Wayne Swan has offered his condolences to New Zealand after the death of the two soldiers.
Mr Swan said, in particular, their thoughts are with the families who have lost loved ones and who are grieving.
He said his thoughts were also with the soldiers injured in the attack.