KABUL, Afghanistan — Two American soldiers were shot to death by an Afghan police officer on Monday in northern Afghanistan, Afghan officials said. It was at least the third time this year that Afghan security personnel had turned on coalition soldiers.

The shooting came after three days of anti-American protests, which claimed at least 24 lives, set off by the burning of a Koran at a church in Florida. It is not known if that had any connection to Monday’s episode, but the attacker was identified as an Afghan border policeman, named only Samarudin, 23, a resident of Mazar-i-Sharif, where the violence began last Friday, and where seven United Nations staff members were killed in rioting.

Scattered protests over the Koran burning continued Monday, but they were largely peaceful.

The two American victims were involved in training the Afghan border police at a base in Maimana city, the capital of Faryab Province, according to Abdul Sattar Bariz, the deputy governor of the province.

“It was an individual act, which could have various reasons or motives, but it does not mean at all that the security situation is bad in the province,” said the governor of Faryab Province, Abdul Haq Shafaq. He said the American trainers had good relations with the border police battalion. “It’s early to say if the shooting had links with the Holy Koran burning or not.”