Updated

A man believed to be a local Afghan police officer shot and killed two NATO troops on Saturday, the coalition said in a statement.

The "insider" attack on the two soldiers occurred in Helmand province in southern Afghanistan, Fox News confirmed. NATO reported that another service member returned fire, killing the gunman.

The shooting Saturday came a day after insurgents in the same region stormed a sprawling British base, killing two U.S. Marines and wounding several other international troops in an attack inspired by an anti-Islam film produced in the United States and the presence on the compound of a high-profile target, Britain's Prince Harry.

NATO would not say if the gunman was a bonafide Afghan policeman or an insurgent who infiltrated the force. Police inspector Hismatullah Baulatzia in the city of Lashkar Gah said it was not clear if the gunman was a member of the Local Afghan Police, a village-level fighting force overseen by the central government.

So far this year, 47 international service members have died at the hands of Afghan soldiers or policemen or insurgents wearing their uniforms. At least 12 such attacks came in August alone, leaving 15 dead and raising concerns that the country will not be able to take charge of its own security as planned by 2014.

The incidents have prompted the Afghan military to run deeper background checks on its troops, leading to the dismissal or detention of hundreds. Meanwhile, the U.S. has halted the training of about 1,000 trainees in the Afghan Local Police, one of several measures being taken to stem the attacks.

The raid a day earlier took place in an area just to the northwest, NATO said. Nearly 20 insurgents armed with guns, rocket-propelled grenades and explosive vests infiltrated the perimeter of Camp Bastion shortly after 10 p.m. Friday, starting a firefight that didn't end until Saturday morning.

Jamie Graybeal, a coalition spokesman, confirmed that two U.S. Marines died in the attack. He said two insurgents wearing suicide vests took part in the assault, although he did not say whether they blew themselves up. In the ensuing battle, coalition forces killed 18 militants and captured a wounded fighter, who is now undergoing medical treatment. NATO is still assessing the damage to aircraft and buildings on the air field.

The Taliban claimed responsibility for that attack, saying it wanted to avenge Muslims insulted by the amateurish film that mocked the Prophet Muhammad -- the main motivator in a string of protests across the region this week -- and also because the British prince is serving on the base.

Fox News' Conor Powell and the Associated Press contributed to this report.