Attackers hit international forces, the Afghan army and Afghan civilians in two days of violence that by Monday morning had left 29 people dead -- two of them American soldiers killed by an Afghan colleague.

In the deadliest attack, insurgents beheaded 17 Afghan civilians for taking part in a music event in a Taliban-controlled area of southern Afghanistan, officials said. The attack happened Sunday night in Helmand province's Musa Qala district, said provincial government spokesman Daoud Ahmadi. All of the bodies were decapitated, but it was not clear if they had been shot first, Ahmadi said.

The victims were part of a large group that had gathered for a celebration involving music and dancing, said Musa Qala government chief Neyamatullah Khan. He said the Taliban slaughtered them to show their disapproval of the event. Information was only trickling out slowly because the area where the killings occurred is completely Taliban controlled, Khan said.

Then on Monday morning, two American soldiers were shot and killed by one of their Afghan colleagues in the east, military officials said, bringing to 12 the number of international troops -- all Americans -- to die at the hands of their local allies this month.

But Afghan officials said Monday's attack in Laghman province was a separate case from the rash of recent insider attacks on international forces, because it appeared to have been an accidental shooting.

When the group of U.S. and Afghan soldiers came under attack, they returned fire and ran to take up fighting positions, said Noman Hatefi, a spokesman for the Afghan army corps in eastern Afghanistan. But an Afghan soldier fell and accidentally discharged his weapon, killing two American soldiers with the errant rounds, he said.

"He didn't do this intentionally. But then the commander of the unit started shouting at him, `What did you do? You killed two NATO soldiers!' And so he threw down his weapon and started to run," Hatefi added. The U.S. troops had already called in air support to help with the insurgent attack and the aircraft fired on the escaping Afghan soldier from above, killing him, Hatefi said.

NATO spokesman Lt. Col. Hagen Messer of Germany confirmed that two international soldiers were killed by an Afghan soldier in Laghman province, but declined to give further comment.

Insider attacks have been a problem for the U.S.-led military coalition for years, but it has exploded recently into a crisis. There have been at least 33 attacks so far this year, killing 42 coalition members, mostly Americans. Last year there were 21 attacks, killing 35; and in 2010 there were 11 attacks with 20 deaths.

Meanwhile, Helmand officials reported that 10 Afghan soldiers were killed in an attack on a checkpoint in the south, and five were either kidnapped or joined their assailants.

Ahmadi, the provincial spokesman, said insurgents attacked the checkpoint in Washir district Sunday evening. Another four soldiers were wounded he said.

Ahmadi did not provide details of the attack. He said the five missing soldiers left with the insurgents but it was unclear if they were kidnapped or went voluntarily.