Two Afghan soldiers attacked US-led NATO forces (ISAF) in western Afghanistan on Saturday -- injuring a Spanish soldier -- in the latest "insider" attack in the country, officials said.

An ISAF spokesman in Kabul said that the attack by two Afghan National Army (ANA) soldiers, one of whom died, occurred in Muqur district of Badghis province in the early hours of Saturday.

"Two ANA service members turned their weapons against ISAF forces in Badghis province," the spokesman said, adding that one ISAf soldier was injured.

Spain's Ministry of Defence said in a statement that the Afghan soldiers entered a combat outpost where they "opened fire and threw several grenades".

"A Spanish instructor lieutenant was slightly wounded in one arm, and one of the attackers died," the statement added, saying the other assailant was captured by ANA and a third man was suspected of involvement.

A provincial spokesman confirmed the incident but said that only one attacker, an ANA soldier who "was suffering from mental problems", was involved.

"The soldier who opened fire was suffering from mental problems, he was wounded when ISAF forces returned fire and later detained by Afghan and ISAF forces," provincial governor spokesman Sharafudin Majidi told AFP.

Shootings by Afghan forces have taken an increasing toll on NATO troops and have seriously undermined trust between NATO forces and their Afghan allies in the fight against hardline Islamist Taliban insurgents.

In the most recent previous attack a man in Afghan police uniform opened fire on NATO-led coalition forces in southern Helmand province on October 30, killing two British soldiers.

The Afghan conflict has seen a surge in insider attacks this year, with more than 50 ISAF troops killed by their colleagues in the Afghan army and police.

There are presently around 100,000 US-led forces fighting alongside Afghan security forces against a Taliban-led insurgency that has been raging in the war-torn country since a US-led invasion toppled the Islamist regime in late 2001.

NATO combat forces are scheduled to withdraw from Afghanistan by the end of 2014.