So-called "green-on-blue" insider attacks by Afghan soldiers on international service members were a major problem several years ago, but now occur less frequently after security measures were improved and the number of foreign troops in the country fell sharply.
In March, three US soldiers were wounded when an Afghan soldier opened fire on them.
The attack comes as President Donald Trump's administration weighs an increase in troops in the war-torn country.
Reuters reported in late April that Trump's administration was carrying out a review of Afghanistanand conversations are revolving around sending between 3,000 and 5,000 US and coalition troops to Afghanistan.
Deliberations include giving more authorities to forces on the ground and taking more aggressive action against Taliban fighters. This could allow US advisers to work with Afghan troops below the corps level, potentially putting them closer to fighting, a US official said.
Earlier this year, the top US intelligence said the security situation in Afghanistan will further deteriorate even if there is a modest increase in US military support for Afghanistan.
In some cases Afghan troops have been forced to abandon more scattered and rural bases, and the government can claim to control or influence only 57 percent of the country, according to US military estimates from earlier this year.
A spokesman for the US military command in Kabul said they were aware of the report, but could not yet confirm any details.
A White House spokesman said Trump was "following the emerging situation in Afghanistan" where the soldiers were killed.
Taliban spokesman Zabihullah Mujahid said the shooter was a member of the militant group and had killed four Americans and wounded several more.
(Additional reporting by Josh Smith in Kabul, and Phil Stewart, Idrees Ali in Washington. Writing by Lesley Wroughton in Washington.; Editing by Marguerita Choy and Chizu Nomiyama)