Updated

Two Americans training security forces were killed Monday by a man in an Afghan police uniform, Afghanistan's president said.

Hamid Karzai condemned the killing of what he described as two American trainers. There were no further details in a statement released by his office. Karzai offered his condolences to the men's families.

"According to reports this morning, two American trainers were killed by a person with a police uniform in the capital of Faryab province. Hearing this report, President Karzai was saddened and expressed his deep condolences to the families of both trainers who were killed in the incident," the statement said.

NATO said earlier that a man wearing an Afghan border police uniform shot dead two of its service members inside a compound in northern Afghanistan. It did not provide their nationalities.

It was unclear if the attacker was an Afghan police officer who turned on his Western counterparts or an insurgent who put on a uniform to infiltrate the base.There have been cases of both in Afghanistan.

The assailant fled the scene and NATO and Afghan authorities were investigating the shooting, which took place in the northern city of Maymana, said Interior Ministry spokesman Zemeri Bashary. He refused to provide further details.

Attacks by Afghan police and soldiers have appeared to increase over the past 12 months as NATO and Afghan forces work more closely together. In some cases, such shootings have been a result of arguments that turned violent. In others, the Taliban has claimed that Afghan shooters were sleeper agents.

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 shooting came as protests broke out again in Afghanistan over a Florida pastor's burning of the Quran, making four straight days of demonstrations -- some deadly -- against the destruction of Islam's holy book. At least 21 people have been killed in the past three days of protests across the country.

The violence was set off by anger over the March 20 burning of the Koran by a Florida church -- the same church whose pastor had threatened to do so last year on the anniversary of the Sept. 11 attacks, triggering worldwide outrage.

The Koran burning appears to have inflamed a simmering anti-foreigner sentiment in the country, where anger about civilian casualties and international contractors making fortunes off the long-running conflict have worn down the welcome for Western forces over more than nine years of fighting.

Hundreds gathered in two separate protests in the east Monday -- one in Laghman province and one in neighboring Nangarhar, but both ended without major violence.

The Laghman demonstration briefly threatened to turn into another melee as about 300 protesters brandished sticks and threw stones at police, who fired shots in the air to disperse the crowds, according to an Associated Press photographer at the scene.

The protest started in Alingar district and the shouting crowd moved toward the provincial capital of Mihtarlam, where they clashed with officers who wanted to keep them out of the city, said Gen. Abdul Aziz Gharanai, the provincial police chief. No one was injured, he said.

In Nangarhar's Ghanikhail district, hundreds blocked a main road and burned an effigy of the Florida pastor, the Rev. Terry Jones, before disbanding after about an hour and half, according to an AP photographer.

The violence started Friday when thousands of demonstrators in the previously peaceful northern city of Mazar-i-Sharif poured into the streets after Friday's Muslim prayer services and overran a U.N. compound, killing three U.N. staff members and four Nepalese guards.

A spokesman for Karzai said two delegations have been appointed to investigate the protest in Mazar-i-Sharif and others in Kandahar to find out why Afghan security forces could not control the crowds and what caused the demonstrations to turn violent.

Karzai has called on the international community to repudiate acts of Koran desecration and other acts that are offensive to the faiths of others and punish those responsible for the burning, spokesman Waheed Omar said.

"This is a very sensitive topic for the Afghan people," he said.

NATO also said one of its service members was killed Sunday in an insurgent attack in the east. NATO did not disclose other 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.

Meanwhile, the Afghan government said it thwarted a pair of suicide attackers who attempted to assault a court office in Lashkar Gah, the capital of southern Helmand province. Police ambushed the attackers before they could reach their target, the Interior Ministry said. One of the bombers detonated his explosives, while the second was shot dead by police. One police officer and one civilian were injured in the clash, the government said.