A gunman wearing an Afghan military uniform shot and killed 2 American troops and injured at least 6 others in the eastern Afghan province of Nangarhar, according to military sources on Sunday.

The attack took place on Saturday evening in the district of Sher Zad, and targeted a base where both US troops and Afghan special forces conducted joint operations.In a tweet, the US Army's 7th Special Forces Group (Airborne) said "several" of its soldiers were killed or injured during combat operations in Afghanistan.The assailant was also killed in the clash, Sohrab Qader, a provincial council member in Nangarhar, said in a statement.Between 12,000 and 13,000 US troops are currently serving in Afghanistan, as part of the US-led Nato mission to train, assist and advise Afghan forces.President Donald Trump last week pledged that the US was focussed on ending "its longest war", during his annual State of the Union address.Six US soldiers have been killed in Afghanistan since the start of 2020, a figure which includes Saturday's casualties. Last year, 22 US personal died in combat operations there."Current reports indicate an individual in an Afghan uniform opened fire on the combined US and Afghan force with a machine gun," US military spokesman Col Sonny Leggett said.The motive behind Saturday's incident was unclear and an investigation was ongoing, he added.Provincial governor Shah Mahmood Meyakhil told AFP that three Afghan commandos were also killed in the shootout.

Meyakhil said it was not immediately clear if the incident was a deliberate act by an "infiltrator" or an accident, but denied earlier reports that it had been a "clash between forces".

No group has yet claimed responsibility, according to local Afghan Tolo news.

In July, an Afghan soldier killed two US troops as they were visiting an Afghan army base in Kandahar. Such insider attacks are sometimes called "green-on-blue" incidents, alluding to the colours of their respective military uniforms.

That came two weeks after another Afghan soldier shot and killed an influential Afghan army colonel while he was conducting a security assessment in Ghazni province.

In December, Taliban infiltrators in the Afghan military killed nine Afghan soldiers in central Afghanistan.US diplomats have for months been engaged in talks with the militant group, who now control over half the country, to agree on a timetable for the withdrawal of foreign forces in exchange for security guarantees.US special envoy Zalmay Khalilzad has led the negotiations, which require the Taliban ensure the country is not used as a safe haven for launching attacks on other countries.Observers are sceptical of the proposed deal, with Trump himself declaring talks "dead" in September last year amid continued Taliban violence.Agencies contributed to this report.