Image copyright AFP/Getty Images Image caption Some 13,000 US troops remain in Afghanistan

Two US troops as well as an Afghan soldier have been killed in an attack in eastern Afghanistan.

Nine people were injured in the attack in Nangarhar province on Saturday.

"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.

Some 13,000 US troops remain in Afghanistan after the US intervention to oust the Taliban in 2001.

"We are still collecting information, and the cause or motive behind the attack is unknown at this time," Col Leggett said in a statement.

The attacker who opened fire was also killed during the clash, Sohrab Qaderi, a provincial council member in Nangarhar, told Reuters news agency.

The Afghan ministry of defence said a delegation was investigating the incident together with the US team in Nangarhar.

During a visit to American troops in Afghanistan last November, US President Donald Trump pledged to "substantially" reduce troop numbers.

Media playback is unsupported on your device Media caption Donald Trump told US troops it was the first Thanksgiving that he didn't get any Turkey

The Taliban now control more territory than at any point since they were ousted in 2001.

Peace talks between the US and the militants have stalled in recent months.