A US service member has been killed in an apparent insider attack in southern Afghanistan.
Two other American military personnel were injured in the attack and are in a stable condition, according to the NATO-led Resolute Support mission.
The name of the dead service member will be released 24 hours after family have been told, the mission added.
In a statement, the Taliban said that a member of the Afghan security forces had opened fire on US troops in Uruzgan, killing four people and wounding several others.
The reason for the discrepancy in the numbers is not clear, but it is possible the other three deaths were fellow Afghans.
The NATO mission did not confirm the province where the attack took place, but a local police officer told the AFP news agency that the shooting happened at the airport in Tarinkot, the capital of Uruzgan province.
Taliban spokesman Qari Yosuf Ahmadi said the attacker had acted alone but that the group had “appreciated” the attack.
Neither side has given details about what happened to the attacker.
Insider attacks, known as “green on blue”, were once a regular feature of the Afghanistan conflict but they had become less common in recent years.
The last one killed a Romanian soldier in August 2017.
They involve Afghan military personnel or someone wearing their uniform attacking coalition troops.
Officials say most are due to personal grudges and misunderstandings rather than insurgent plots.
Similarly, “green on green” incidents are when Afghan security forces attack their own.
There were 47 of these last month alone, according to a Pentagon report.
There are around 15,000 foreign troops in the country, most of them from the US.
At the conflict’s highest point, there were more than 130,000 troops from NATO and supporting countries.
Despite the withdrawal, however, little has changed for Afghans.
They remain torn between local security forces, a resurgent Taliban, Islamic State fighters maintaining footholds in the north and east of the country and intensified bombing by US forces.
The UK ended combat operations in Afghanistan in October 2014, withdrawing the last of its combat troops.
A small number of British service personnel remain, most of them in Kabul where they provide force protection and a training and advisory role to the Afghan National Army Officer Academy and Afghan National Police.