Afghan officials held the Taliban responsible for Wednesday's attack.
"Taliban ambushed Afghan soldiers patrolling in Nawbahar ... two of them have also been arrested in the incident," provincial deputy police chief Ghulam Jailani Khan said.
"They used AK-47s and heavy machine guns and after resisting for three hours they fled to the mountains."
Abd al-Latif Hakimi, referring to himself as a spokesman for the Taliban, said four of the movement's fighters were wounded in the shooting, but put the government toll at 21.
"We ask the entire Afghan nation not to cast votes in the US forged elections or to be prepared for the worst," Hakimi said.
In a separate incident in northern Afghanistan a grenade attack on a Nato peacekeeping camp left two Germans and one Swiss soldier wounded.
The German defence ministry on Wednesday said the three soldiers were being treated by the doctors at the scene in Kunduz, where they were part of a Nato provisional reconstruction team under German command.
None of the soldiers were in life-threatening danger, a ministry spokesman said. Wednesday's attack occurred an hour after the soldiers heard another explosion some 500m outside their camp.
Karzai's critics say he is only doing
More than 1000 people have been killed since August last year in fighting blamed on the Taliban, which was toppled from power in a US-led invasion of Afghanistan.Most of the 18 presidential candidates have called for the poll to be delayed until security improves and after the dust settles in the November US election.
But US-backed interim President Hamid Karzai, who is also a US favourite to keep his job, has insisted the vote will be held as scheduled.
Some tribal leaders say the Afghan election is being used to boost Bush's image for the forthcoming US elections and accuse Karzai of being a US stooge.
Several residents of Zabul province told Aljazeera.net they were being harassed by Afghan government officials, who had coerced them into getting a "Karzai card".
In some areas they are being threatened with deprivation of basic amenities such as medical care, security and food aid in order to register, they said.
Adam Khan Zadran, from Zadran village in the province of Logar, told Aljazeera.net: "The Taliban maintained law and order. Now it's all in a mess. Since the Americans came, they have ensured that lawlessness prevails".
"There is no safety. Outside Kabul it's even worse"
Adam Khan Zadran, resident of Zadran village in Logar province
"Everyone [the media] shows Kabul as a safe and busy city. But they don't say that at night it is very dangerous to be outside. There is no safety. Outside Kabul it's even worse," he said.
Zadran said in his area "the current governor, who was here before Taliban rule and was reinstated by Karzai, has sold land belonging to local villagers. When some of the villagers returned, asking about their land, they were told by the new inhabitants that it was sold to them by the governor himself".
Wary of vote
Furthermore, Zadran accused the governor of Logar province, known as Doctor Fadhl Allah, of enriching himself and funding his army in the region at the expense of locals.
Fadhl Allah was the governor of three provinces in Afghanistan prior to the Taliban government, Logar, Ghazmi and Maidan, according to Zadran, but Karzai appointed him head of the army for these provinces as well.
Zadran told Aljazeera.net that residents "wonder what type of elections it will be, especially when Karzai's government has no control over the country".
"Some parts of the country are practically no-go zones. Even Karzai's government people can't go there, it's so dangerous," Zadran said.
He said "corruption is rampant and the leaders are just abusing their power, they do as they wish".
"The whole country is in a mess, with fighting and shooting all over the place. All we ask for is some stability and most of all, security," he said.
With only 11 days remaining before voting gets under way Zadran expects an increase in unrest.