A man wearing an Afghan border police uniform shot dead two American military personnel tasked with helping train members of the country's security forces on Monday, NATO and Afghan officials said.

The assailant fled and it was not known whether he was a police officer who turned on his Western counterparts or an insurgent disguising himself in uniform to infiltrate the northern compound and attack from inside. There have been cases of both in Afghanistan, exposing the vulnerability even of foreign trainers involved in preparing Afghan forces to take the lead in battling the Taliban.

Afghanistan's security forces, meanwhile, were struggling to contain days of protests set off by the burning of a Quran at a small Florida church two weeks ago. The desecration of Islam's holy book has inflamed anti-foreigner sentiment already at high levels because of civilian causalities. On Monday, rock-throwing crowds hundreds deep clashed with Afghan police in several places in the east.

NATO said the assailant in Monday's attack wore an Afghan border police uniform and shot the two service members inside a compound in northern Faryab province before escaping. The international military alliance did not provide further details.

President Hamid Karzai's office condemned the attack and said the dead were American trainers. A spokesman for the Interior Ministry said the attack occurred in the provincial capital, Maymana.

Attacks by Afghan police and soldiers appear to have increased over the past 12 months as NATO and Afghan forces work more closely together.

In the last such attack in January, an Afghan soldier approached two Italian soldiers cleaning their weapons and shot them dead before escaping from the base. One of the deadliest such shootings occurred in November when an Afghan border police officer opened fire on NATO troops during a training mission in eastern Nangarhar province, killing six NATO service members before he was shot dead.

Monday's protests over the March 20 Quran burning in Florida took place in the neighboring eastern provinces of Laghman and Nangarhar. Both ended without major injuries being reported.

At least 21 people have been killed in protests that started Friday with an attack on a U.N. compound in the northern city of Mazar-i-Sharif that killed three U.N. staff members and four Nepalese guards.

The protests have been more peaceful in recent days but have spread throughout the country and included the burning of effigies of the U.S. president and shouts for American troops to leave.

Karzai said Monday that he has sent a delegation to investigate the protest in Mazar-i-Sharif and others in the southern city of Kandahar to find out why Afghan security forces could not control the crowds and what caused the demonstrations to turn violent.

He said he met with the U.N. chief in Afghanistan on Monday and expressed his condolences for the deaths of the U.N. staffers on behalf of the Afghan people.

He also asked the delegation to do more to increase religious tolerance worldwide. He has previously called on the international community to punish those responsible for the Quran burning.

The Dove Outreach Center in Gainsville, Florida, is the same church whose pastor, the Rev. Terry Jones, first threatened to burn a Quran last year on the anniversary of the Sept. 11 attacks, triggering international outrage.

Members of the U.N. delegation assured Karzai the attack would not hinder the U.N. mission in Afghanistan, according to the president's statement. The U.N. has greatly increased its security measures, cut international staff in country and curtailed staff movements since a 2009 attack on a residential hotel that killed five U.N. staffers.

NATO also said one of its service members was killed Sunday in an insurgent attack in the east. NATO did not disclose details or the service member's nationality. The majority of troops in the east are American.

The latest deaths bring to 104 the number of NATO service members killed so far this year. In the same period of 2010, 129 NATO troops died.

___

Rahmat Gul contributed to this report from Mihterlam, Afghanistan.