The boy, whose age is unknown, had been carrying what looked like an automatic rifle near the Bagram Airfield, 50 kilometers (31 miles) from Kabul in neighboring Parwan province, said the provincial police chief, Gen. Zaman Mamozai.
An American soldier had warned the boy from a watchtower to stop, he said.
Local people gathered near the base to protest the killing of the boy, but dispersed once they were told about the circumstances, Mamozai said. He said the incident is being investigated.
Earlier, an Afghan official said overnight attacks by the Taliban on two police checkpoints in the volatile southern province of Helmand killed at least eight police.
Also Read
Col Almas Kahn, deputy police chief in Helmand, said the attack happened in the Gereshk district around midnight. Though Kahn blamed the Taliban, the group did not immediately claim responsibility for the attack. Afghan forces have been trying to reduce the number of checkpoints as they are vulnerable to insurgent attacks.
Separately, the Taliban claimed responsibility for firing a series of rockets at Kabul's new parliament building early today. No casualties were reported.