Two American troops were killed and six others wounded when an Afghan soldier armed with a machine gun opened fire, the US military confirmed on Sunday.The deaths come at a sensitive time in the 18-year-old war, with US President Donald Trump eager to bring troops home and end the longest conflict in US history.READ | 'No ceasefire plans' in Afghanistan, say TalibanThe incident occurred late on Saturday in Nangarhar province in eastern Afghanistan when US and Afghan commandos were conducting a "key-leader engagement" at a base in Sherzad district."Current reports indicate an individual in an Afghan uniform opened fire on the combined US and Afghan force with a machine gun," US Forces-Afghanistan spokesperson Sonny Leggett said in a statement on Sunday.Provincial governor Shah Mahmood Meyakhil said in an audio message to reporters that three Afghan commandos were wounded.Deadliest yearHe said it was not immediately clear if the incident was a deliberate act by an "infiltrator" or an accident."It was not a clash between the forces. We are investigating," Meyakhil said.Leggett also stressed the cause or motive behind the attack were not immediately known.In a tweet, the US Army's 7th Special Forces Group (Airborne) said "several" of its soldiers had been killed or injured during combat operations in Afghanistan.No group immediately claimed responsibility for the incident.Last year was the deadliest for US forces in Afghanistan since combat operations officially finished at the end of 2014, highlighting the challenging security situation that persists.Depending on how one qualifies combat deaths, about 20 American troops were killed in 2019. Since the US-led invasion in October 2001, about 2 400 US troops have been killed in combat in Afghanistan.In December, Taliban infiltrators in the Afghan military killed nine Afghan soldiers in central Afghanistan.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.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.US special envoy Zalmay Khalilzad has been negotiating with the Taliban for about 18 months for a deal that would see the Pentagon pull thousands of troops from Afghanistan.In return, the Taliban would guarantee the country is not used as a jihadist safe haven.Many are sceptical of the proposed deal and Trump himself declared talks "dead" in September amid continued Taliban violence.Negotiations have since resumed in Qatar.