A rogue Afghan army soldier killed four foreign troops in eastern Afghanistan on Friday, a NATO coalition spokesman said, adding to a string of similar shootings which have eroded trust between Afghan security forces and their Western allies.

An Afghan intelligence security source said four French soldiers were killed and 17 others wounded by an Afghan soldier in the Taghab valley of eastern Kapisa province. The gunman had been detained, the coalition spokesman added.

The shooting was the latest in a string of attacks by rogue Afghan soldiers and police on their foreign partners, or by insurgents who had infiltrated security forces.

Dozens of foreign soldiers have been killed in recent years by what NATO dubs the insider threat, complicating coalition efforts to train Afghanistan's army and police force before foreign combat troops leave by the end of 2014.

Two French Foreign Legion soldiers and one American were killed in separate episodes of so-called green-on-blue shootings last month, which refer to the colours of the Afghan army and the symbol of NATO, although the coalition no longer releases the number of its troops killed by Afghan soldiers.

In November, an Afghan soldier shot and wounded three Australian and two Afghan soldiers in the south, less than two weeks after an Afghan soldier shot and killed three Australian soldiers and an Afghan interpreter.

And in September last year, an Afghan guard employed by the U.S. embassy opened fire inside a CIA office in Kabul, killing an American contractor.

Friday's deaths bring the total number of French soldiers killed in Afghanistan to 82 since France joined the international military operation in Afghanistan in 2001.

Separately, six foreign soldiers were killed in a helicopter crash in southern Afghanistan on Thursday, with NATO denying the craft was brought down by insurgents, the coalition's International Security Assistance Force (ISAF) said.

The Taliban, which often makes exaggerated claims of military successes, claimed to have shot down the helicopter, but an ISAF spokesman said their were no militants in the area when the crash occurred.

It is the worst crash since August last year when 30 soldiers, mostly elite U.S. navy SEAL commandos, died when their helicopter came down in eastern Afghanistan.

(Writing by Rob Taylor; Editing by Amie Ferris-Rotman and Ed Lane)