Three more U.S. Marines have been shot dead by an Afghan worker on a base in southern Afghanistan, in a deadly 24 hours for U.S. forces during which six American soldiers were killed in rogue attacks by supposedly friendly Afghans.

The shooting took place Friday night in the Garmsir district of Helmand province, where three U.S. special forces soldiers were killed by an Afghan policeman and comrades earlier in the day, Reuters reported.

"Let me clearly say that those two incidents clearly do not reflect the overall situation here in Afghanistan," the chief NATO force spokesman, Brig. Gen. Gunter Katz, told reporters on Saturday.

The Taliban claimed responsibility for both attacks on Friday in Helmand province - an area of the south where insurgents have wielded their greatest influence, the Associated Press reported. 

The three Marines were shot by a base employee who turned a gun on them, in the third rogue attack in four days. Foreign military sources said the man had not been wearing a uniform and it was unclear how he got hold of the weapon.

The gunman has been detained and a joint Afghan-NATO investigation team is reviewing security and looking into the reason for the attack.

In the first attack, an Afghan police officer shot and killed three Marines after sharing a pre-dawn meal with them in the volatile Sangin district, according to Afghan officials. A U.S. Defense Department official confirmed that the dead Americans were Marine Special Operations Forces.

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, a village-level defense force overseen by the Ministry of Interior. The district chief, Mohammad Sharif, said the shooting happened at a police checkpoint after a joint meal and a security meeting. The meal took place before dawn because of Ramadan, the month in which Muslims abstain from food during daylight hours.

NATO calls such incidents green on blue attacks.

The NATO force says there have been 26 such attacks on foreign troops since January in which 34 people have been killed. Last year, there were 21 attacks in which 35 people were killed.

But a coalition spokesman said the killings by the Afghan worker would not be included in that tally as it did not involve a member of the Afghan security forces.

Green on blue shootings, in which Afghan police or soldiers turn their guns on their Western colleagues, have seriously eroded trust between the allies as NATO combat soldiers prepare to hand over to Afghan forces by 2014, after which most foreign forces will leave the country.

President Hamid Karzai condemned the latest killings, ordered investigations into the incidents and directed relevant Afghan authorities to work to ensure the safety within training and security institutions.

"The enemy who does not want to see Afghanistan have a strong security force, targets military trainers," Karzai said in a statement.