An Afghan soldier has opened fire on US troops, killing one and wounding at least two others before the attacker was shot to death, according to an American official.

General Fazel Ahmad Sherzad, police chief for the eastern Nangarhar province, confirmed the incident, adding that it happened on Wednesday after a meeting between Afghan provincial leaders and a US embassy official, the Associated Press news agency reported.

Al Jazeera's Jennifer Glasse, reporting from Kabul, said another Afghan soldier was injured in the firefight, which occurred at the provincial governor's compound in Jalalabad.

Information of the attack remains unclear as a witness told AP that four US troops had been wounded in the attack, not three as Sherzad said, while an official in Washington, DC, speaking on condition of anonymity, confirmed that one of them had died.

NATO confirmed one of its soldiers died in the attack without providing the nationality of the slain soldier, AP's report added.

The incident is the second insider attack in 2015, after an Afghan soldier killed three American security contractors on January 29.