Two NATO soldiers who were killed by Afghan colleagues on Thursday were Americans and two of the three gunmen were Afghan government troops, the Pentagon said.

The attack raised the death toll to six Americans killed by Afghan associates in the week since angry protests broke out over the burning of the Koran at a US base at Bagram.

"We believe that two individuals from ANSF (Afghan security forces) were involved in the attack and a civilian Afghan as well," Pentagon press secretary George Little told reporters.

"Two of the attackers were subsequently killed by our forces" but the fate of the civilian assailant was still unknown, he said.

The Afghan civilian was a literacy teacher working in the outpost who grabbed a weapon from a soldier and opened fire, Zhary district chief Niaz Mohammad Sarhadi told AFP.

The attack occurred at a military outpost in the southern province of Kandahar, the spiritual birthplace of the Taliban.

Even before the uproar over the Koran burning, which the United States has called a "tragic mistake," relations have been tense between Afghan and NATO forces, with a rising number of "insider" attacks that have targeted alliance trainers.

NATO took the extraordinary step of withdrawing all its advisors from Afghan government ministries last Saturday after two US officers were shot in the head within the interior ministry, apparently by an Afghan colleague.

However, the Pentagon said it was unclear if the latest incident was connected to the Koran burning and insisted that there were no plans to abandon a NATO strategy that relies on cooperating with Afghan government forces.

"We're staying the course in Afghanistan. We have confidence in our ability to work closely with the ANSF," Little said.

"Don't get me wrong. These are troubling incidents when they occur and we fully recognize that we've seen several of these incidents in recent weeks," he said.

He said despite recent setbacks "the overall trend is positive" in the war and that the Taliban insurgency had been weakened and was "on its heels."