Taliban claims responsibility for latest ‘green-on-blue attack’ during joint operation in Achin district of Nangarhar.

Three US soldiers were fatally shot and a fourth was wounded in eastern Afghanistan, the Pentagon confirmed on Saturday following reports that an Afghan army soldier turned his weapon on US soldiers.

Afghan officials initially said two soldiers had been killed, but a Pentagon statement said three US soldiers were killed and one US soldier was wounded.

The Taliban claimed responsibility for Friday’s “insider attack”, which occurred in the district of Achin.

“In joint US-Afghan military operation, two American troops were killed when an Afghan member of army commando opened fire on them,” Attaullah Khogyani, a provincial spokesman, told Al Jazeera, adding that two other US troops were wounded.

“The Afghan commando was also killed in the counterattack.”

Zabihullah Mujahid, Taliban spokesman, claimed four US soldiers were killed in the attack.

The group and the official numbers usually differ.

Kazem, an Afghan army soldier, told Al Jazeera that such attacks are sometimes planned by the Taliban, but most of the time it is caused by minor disagreements between the two sides.

“Such attacks are well planned when they are done by the Taliban. It seems most of them are manipulated and dragged into the trick of ‘fighting for Islam’,” he told Al Jazeera.

“Sometimes the Taliban also kidnap a family member of the soldier and blackmail him to kill the US troops to cause a maximum number of casualties in such attacks.”

READ MORE: Fear penetrates Kabul after deadly cycle of violence

So-called green-on-blue attacks – when Afghan soldiers or police turn their guns on international troops – have been a major problem during NATO’s long years fighting alongside Afghan forces.

The killings have bred fierce mistrust between local and foreign forces even as the rate of such incidents has dropped in recent years.

Three Americans were wounded in March when an Afghan soldier opened fire in southern Helmand province, in the first known insider attack on international forces this year.

US attacks on Afghans

Attacks on Afghan troops by US forces in the past have also caused mistrust between the two.

Several members of the Afghan security forces were killed on Friday when a US military aircraft opened fire during an overnight operation in Helmand province.

Local news media reported at least two deaths, while Omar Zwak, a spokesman for Helmand’s governor, told Al Jazeera that three officers were killed and two were wounded.

READ MORE: NATO troop increase plan draws criticism in Afghanistan

The US military command in Afghanistan released a statement saying that the “friendly-fire” incident “resulted in the deaths and injuries” and that an investigation is being conducted.

It said the officers were killed when a US aircraft “returned fire” during the operation, which included Afghan and American special forces.

The Afghan conflict is the longest in American history. US-led NATO troops have been at war there since 2001, after the toppling of the Taliban government.

US troops in Afghanistan number about 8,400 today, and there are another 5,000 from NATO allies, who mainly serve in a training and advisory capacity.