KANDAHAR, Afghanistan — Wasil Ahmad learned to fire a gun at age 9 after his father was killed by Taliban militants.

Before long, his uncle said, the boy had become a celebrated Taliban killer, credited with gunning down six insurgents during a battle last summer.

Wasil was waiting at a fruit stand in Tarin Kowt, the capital of southern Afghanistan's Uruzgan province, on Monday when he was shot dead by two gunmen. His uncle said he was 12 years old.

The boy's death — in a conflict that began before he was born — has made national headlines and served as a grave reminder that children continue to fight and die on all sides of the enduring hostilities in Afghanistan.

The United Nations documented 68 cases of children, including three girls, being recruited by government forces or insurgents in 2014. Afghan news media often broadcast video confessions by reported child bombers recruited by the Taliban. The government signed a 2011 U.N. plan to prevent the recruitment and use of underage fighters, but the practice continues, particularly among anti-Taliban militias in remote areas that have government support but are not formally part of Afghan security forces.

Interior Ministry spokesman Sediq Sediqi said via text message Wednesday that the government “doesn't recruit children.” Wasil's uncle, Abdul Samad, a police commander in Uruzgan, said in a telephone interview that the boy was not a member of any formal force.

“He had to take up arms,” Samad said. “He was defending his home, his family.”

In Samad's telling, Wasil picked up an AK-47 rifle after his father was killed three years ago in battle against the Taliban. He said he wanted revenge.

The boy proved a quick study, learning to fire shotguns, pistols and heavy weapons.

The real test of Wasil's ability came last summer when the family home in Khas Uruzgan district came under a 71-day Taliban siege.

Wasil shot and killed six Taliban fighters in that period, his uncle said. Wasil's father, in his years fighting the Taliban, killed 13 of its members, Samad said.

The circumstances of the boy's death remained murky. Samad said Wasil was carrying a pistol Monday but did not fire a shot. He was shot twice, in the head and the shoulder, Samad said. No group has claimed responsibility for the killing. The Taliban did not respond to questions.

Officials in Uruzgan and others hailed Wasil as a hero, but some said his story offered yet another example of the price paid by Afghan youths in the more than 14-year conflict. In the first six months of 2015, the U.N. mission in Afghanistan documented 1,270 casualties among children — 320 deaths and 950 injuries.

Special correspondents Ali M. Latifi and Abdul Matin Amiri reported from Kabul and Kandahar, Afghanistan, respectively.