The civilian was a literacy teacher who grabbed a weapon from a soldier and opened fire in a military outpost in troubled Kandahar province, Zhary district chief Niaz Mohammad Sarhadi told AFP.
"Two individuals, one believed to be an Afghan National Army service member and the other in civilian clothing, turned their weapons indiscriminately against International Security Assistance Force and Afghan National Security Force service members in southern Afghanistan today, killing two ISAF service members," ISAF said in a statement.
The US-led NATO force gave no further details.
Sarhadi said the dead soldiers were Americans.
Other troops returned fire and killed the teacher, who was working in the base, and an Afghan army soldier, he said.
If the dead are confirmed to be US troops, it will take the death toll to six Americans killed by Afghan colleagues within a week, since angry protests erupted over the burning of the Koran at a US military base near Kabul.