The shooting occurred in Achin district, where US special forces have been fighting alongside Afghan troops against Islamic State and Taliban militants, said Attaullah Khogyani, a spokesman for the Nangarhar provincial governor.
The commando was also killed in the incident, Khogyani said.
"The cause of the shooting is not clear. An investigation has already begun," he said.
A spokesman for the US military command in Kabul said they were aware of the report but could not yet confirm any details.Taliban spokesman Zabihullah Mujahid said the shooter was a member of the militant group and had killed four Americans and wounded several more.