KABUL, Afghanistan — For the second time in three days, a night raid in eastern Afghanistan by NATO forces resulted in the death of a child, setting off protests on Saturday that turned violent and ended in the death of a second boy.

A NATO spokesman apologized for the child’s death, which took place early Saturday in western Nangahar Province in the Hesarek District, a remote poppy-growing area close to Kabul Province and Logar Province. There has been almost no NATO presence there throughout the war, and the area is thought to be heavily penetrated by the Taliban.

The district governor, Abdul Khalid, said he had feared a Taliban attack on the government center and had called for help from local Afghan security forces. At the same time, there was a raid, he said. “American forces did an operation and mistakenly killed a fourth-grade student; he had gone to sleep in his field and had a shotgun next to him,” he said.

“People keep shotguns with them for hunting, not for any other purposes,” Mr. Khalid said.

The boy was the son of an Afghan National Army soldier, according to Noor Alam, the headmaster of the school the student attended. Although the boy was 15, like many rural Afghans, he was in a lower grade because he had not been able to go to school regularly, local residents said.