The base is close to the village of Sangesar, the birthplace of the Taliban and the hometown of its leader, Mullah Muhammad Omar. Mr. Khan said the attackers were suspected of having links to the insurgency.

The Afghan soldier involved in the shooting, he said, was a platoon leader who had taken part in joint patrols with Americans. The civilian was an Afghan literacy instructor at the base.

“We believe that both of the attackers had links with the Taliban,” Mr. Khan said.

NATO issued a statement that did not give the victims’ nationalities. “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 I.S.A.F. service members,” the statement read.

The deaths of the two Americans at the Afghan Interior Ministry on Saturday prompted NATO to withdraw immediately hundreds of military advisers and trainers from government ministries in Kabul. On Thursday, a NATO spokesman, Brig. Gen. Lewis Boone, said some of the advisers were returning to the ministries, but he did not specify which offices were involved.

Three investigations are under way into the Koran-burning episode at Bagram Air Base last week. Protests prompted by it recurred for days and claimed at least 29 Afghan lives, in addition to those of the American soldiers. One of the investigations is being mounted by Americans, one by Afghans, and the third is a joint inquiry. The formal American military investigation is the only one that can lead to punishment; the others can offer recommendations but carry no legal weight.