The shooting happened in the volatile Sangin district of Helmand province. Sangin was a Taliban stronghold for years and has one of the highest concentrations of improvised explosive devices, or IEDs, in the country.
The gunman fled the scene and remains at large. Sangin's district chief and the Taliban both identified the gunman as Asadullah, a member of the Afghan National Police who was helping the Marines train the Afghan Local Police. The Taliban claims the man joined the insurgency after the attack.
A U.S. Defense Department official confirmed that the dead Americans were Marine Special Operations Forces. He spoke on condition of anonymity because the family notification process was not complete.
NATO says 31 coalition service members have been killed in such attacks so far this year. This is a dramatic rise from previous years. There were 11 such attacks and 20 deaths in 2011, according to the Associated Press. Each of the previous two years saw five such attacks.
The assaults have cast a shadow of mistrust over U.S. efforts to train Afghan soldiers and police. It has also raised further doubts about the quality of the Afghan forces taking over in many areas before most international troops leave the country in 2014.
The Associated Press contributed to this report.