An Afghan policeman killed two soldiers from the NATO-led force in southern Afghanistan Saturday before being himself shot dead, security and coalition officials said.
The incident brought to 47 the number of foreign military personnel killed in insider, or "green-on-blue" attacks this year, by Reuters' count.
The gunman was returning from a security operation in Helmand with coalition soldiers when he turned his gun on them, a security source told Reuters. He killed two soldiers and wounded three others.
A soldier returned fire, killing the attacker, the International Security Assistance Force said.
It was not immediately clear from which country the dead soldiers were.
The gunman was believed to be a member of the 16,000-strong Afghan Local Police, a U.S.-trained militia separate from the police. Training of new recruits was suspended earlier this month following a rise in insider attacks.
Saturday's incident follows the killing of two U.S. Marines and a British soldier in separate incidents in southern Afghanistan on Friday.
The British soldier from 1st Battalion Grenadier Guards was killed by a roadside bomb in an unrelated incident Friday. He died when his vehicle hit an improvised explosive device in the Nahr-e Saraj district of Helmand province.
On Saturday, a Taliban commander told Sky News that Prince Harry was the main focus of the attack on Camp Bastion, but other Taliban spokesmen told media organisations that the attack was in revenge for the anti-Islamic film "The Innocence of Muslims."
The prince, an army captain, is based at Camp Bastion for his second tour of duty.