— For years they were children at war, boys given rifles and training by al-Qaeda-backed militants and sent to the front lines of this country’s bloody conflict. Many had been kidnapped from schools and soccer fields and forced to fight.

The United Nations pleaded for them to be removed from the battlefield. The United States denounced the Islamist militants for using children to plant bombs and carry out assassinations.

But when the boys were finally disarmed — some defecting and others apprehended — what awaited them was yet another dangerous role in the war. This time, the children say, they were forced to work for the Somali government.

The boys were used for years as informants by the country’s National Intelligence and Security Agency (NISA), according to interviews with the children and Somali and U.N. officials. They were marched through neighborhoods where al-Shabab insurgents were hiding and told to point out their former comrades. The faces of intelligence agents were covered, but the boys — some as young as 10 — were rarely concealed, according to the children. Several of them were killed. One tried to hang himself while in custody.

The Somali agency’s widespread use of child informants, which has not been previously documented, appears to be a flagrant violation of international law. It raises difficult questions for the U.S. government, which for years has provided substantial funding and training to the Somali agency through the CIA, according to current and former U.S. officials.

A CIA spokesman declined to comment on the issue. But in the past the U.S. government has supported Somali security institutions — despite well-known human rights violations — citing the urgent need to combat terrorist groups such as al-Shabab.

The child informants were used to collect intelligence or identify suspects in some of the world’s most dangerous neighborhoods, according to their accounts.

“They took me sometimes in a car and sometimes on foot and said, ‘Tell us who is al-Shabab,’­ ” recalled one 15-year-old who said he was held by the intelligence agency. “It’s scary because you know everyone can see you working with them.”

The teenager was one of eight boys interviewed by The Washington Post who described being forced to work as informants after leaving al-Shabab. The boys each spoke alone, through an interpreter, but their accounts were nearly identical. They said they spent years in the custody of intelligence agents and were dragged along on missions, sometimes several times a week. Occasionally, they were told to wear NISA uniforms. They were threatened with violence if they didn’t cooperate, several boys said. Their parents didn’t know where they were.

Somali intelligence agents called the boys “far-muuq,” they said — finger-pointers.

Somalia’s army has long recruited children as soldiers. But for years, U.N. and human rights officials found it difficult to confirm reports about a shadowy government-run center in Mogadishu, which was said to hold children used in intelligence operations. Only late last year did U.N. officials persuade Somali authorities to transfer the boys to a new rehabilitation center, where they would not be accessible to intelligence agents, according to U.N. and Somali officials. That is where The Post interviewed the children.

Somalia’s intelligence chief denied in an interview that the boys were forced to work as informants but said that “high-level” child combatants were — and still are — kept in custody, because they are dangerous and have valuable knowledge. Those boys, he said, sometimes volunteer to go on missions and have yielded “important information” that has helped agents prevent attacks.

“If a child joins al-Shabab when he is 9, by the time he is 16, he is a lion,” NISA’s director, Gen. Abdirahman Turyare, said in an interview. “They are able to point to someone and tell us, ‘That guy, he fought with me.’ ”

Somalia’s intelligence agency continues to keep such boys for months at a time, Turyare acknowledged, in spite of a 2014 agreement to release children to UNICEF within 72 hours of their escaping al-Shabab or being apprehended.

Although details of the CIA’s operations in Somalia are secret, Somali officials said the two agencies work together closely.

“There’s nothing NISA does that the CIA doesn’t know about,” said a senior Somali official, who spoke on the condition of anonymity to discuss sensitive intelligence issues.

‘Easier to manipulate’

During Somalia’s 25-year civil war, which has shifted among rebel factions, clans and Islamist groups and left hundreds of thousands dead, children have constantly been caught up in the fighting.

In 2015, UNICEF recorded more than 300 cases of children being used as soldiers by Somali forces. That practice would normally trigger a U.S. ban on most military aid, but President Obama has granted Somalia a waiver on national security grounds in recent years.

Al-Shabab, which seeks to transform the country into a hard-line Islamic state, has been even more notorious for recruiting children. In some parts of Somalia, the group has ransacked classrooms, kidnapping hundreds of children and sending them to training camps.

The international community, recognizing that child combatants needed to be assimilated back into Somali society, lobbied in recent years for a reintegration program. And the government in 2012 launched a plan that it said would provide former underage soldiers with psychological help and education.

But according to the boys interviewed in Mogadishu, the program they entered was not about rehabilitation. To their surprise, the teens were put to work gathering intelligence.

“Maybe they thought because we were young we would be easier to manipulate,” said one baby-faced 15-year-old who goes by the nickname Yariso, or “Shorty.”

The boys became such fixtures in Somali security operations that witnesses began alerting local humanitarian groups, asking, “Who are these children with NISA?”

In late 2015, after years of pressure from the United Nations, the children were quietly transferred from the government-run detention center to a juvenile rehabilitation facility in central Mogadishu at the Elman Peace and Human Rights Center, which is run by a nonprofit group and receives its funding from UNICEF. Thirty-three of the boys remain. Thirty-one have been released.

But international aid workers and experts suspect that the use of boys as informants continues.

One Somali security official confirmed that “hundreds” of children remain in NISA facilities and are used as intelligence assets. He spoke on the condition of anonymity because he was not authorized to speak on the topic.

In Galkayo, in central Somalia, about 30 former child combatants have been kept in a one-room building since being captured in late March and have faced NISA interrogations, according to several relief workers.

In 2015, Somalia ratified the U.N. Convention on the Rights of the Child, which outlaws the recruitment of children younger than 15 by security forces. Such recruitment is considered a war crime by the International Criminal Court. The majority of the former underage soldiers interviewed by The Post said they began working as informants before they turned 15.

Turyare, the intelligence chief, shrugged off humanitarian groups’ concerns.

“The angle [that UNICEF] is responsible for and the angle we are responsible for is different,” he said.

Other officials said the distinction between child and adult combatants is blurrier in Somalia than in Western countries. For example, in Puntland, a large, semiautonomous region in northern Somalia, the state constitution says anyone older than 14 is considered an adult.

“Here we consider the body, not the age,” said Maj. Gen. Mohamed Sheikh Hamud, Somalia’s police commissioner and former head of intelligence.

U.N. officials in Somalia declined to speak on the record about the intelligence agency’s use of child informants. But Leila Zerrougui, the New York-based special representative of the U.N. secretary general for children and armed conflict, said that being an informant “puts the lives of children in danger and is one of the most dangerous functions they can assume.”

$2 for every suspect

During their years as informants, the boys said, they sometimes were used in operations in Mogadishu and sometimes in towns hours away. Somali agents never told the boys when they would be released from detention, the children said.

“We just assumed we would be working for NISA for the rest of our lives,” said one 16-year-old boy, who, like the other teens, declined to give his full name for security reasons. He agreed to be identified only by his nickname, Hanad.

Another boy, Abdullah, said he was 13 when he joined al-Shabab. By then, the majority of his classmates in a small town in southern Somalia had been recruited. The group’s members didn’t seem to him like terrorists. They offered protection from rival clans and other al-Shabab members.

After about two years of fighting with al-Shabab, Abdullah had had enough. He called an uncle and told him that he planned to defect. The uncle called intelligence agents to pick him up. Abdullah assumed they would interrogate him for a few days before sending him to a rehabilitation center or releasing him.

But the agents kept Abdullah in their custody for more than two years, he said.

Sometimes agents would cordon off a neighborhood and walk a few steps behind Abdullah through the area, he said. He would motion with his hand when he saw someone for the agents to arrest.

“On those trips I saw a lot of family members and friends who were in al-Shabab. I knew if I picked them out, they would be in the same position as me,” Abdullah said. “Sometimes I said nothing. I told the agents, ‘I’ve run out of people.’ ”

On some missions, agents gave Abdullah $2 for every suspect he pointed out, he said.

Other children said they told intelligence agents some information they thought was real — where ammunition was hidden, for example — but also made things up.

“I told them what they wanted to hear,” said Salam, 17. “I thought that would mean I could be freed earlier.”

Some boys were taken to a military court to testify against suspects, according to several of the children. A number of the boys were detained by NISA for more than four years, the teens said.

In recent years, U.N. officials received reports that children had been seen being paraded around by Somali intelligence agents. Gaining access to the boys, however, proved difficult. In 2012, a contingent of U.N. officials and foreign military officers made an appointment to visit the center where the boys were kept.

“But when we arrived, NISA wouldn’t let us in. They gave no reason. We could see the children through the fence outside, but we couldn’t speak to them,” said a military official from an African nation, who spoke on the condition of anonymity because he was not authorized to discuss the incident.

It would be three more years before the children were transferred to the Elman Center, a two-story building in downtown Mogadishu where the boys learn reading and writing, basic computer skills and a bit of English.

On a recent day at the center, boys crowded around a blackboard that listed several functions of a computer.

“Open a file,” the instructor had written. “Save a file.”

“We still have a long way to go, but the leadership displayed by the minister of internal security to remove the children from the facility and hand them over to us for care and rehabilitation is a step in the right direction,” said Ilwad Elman, the center’s director of programs and the daughter of its namesake, Elman Ali Ahmed, a Somali human rights activist who was assassinated in 1996.

Abuses ignored

In 2008, the U.S. Congress passed the Child Soldiers Prevention Act, which was intended to block military assistance to countries that “recruit and use child soldiers.” Every year after it took effect, the State Department has found that the Somali military has been recruiting children, although there has been no mention of child informants.

But under a “national interest” waiver, the United States allocated $330 million to Somalia this year, much of which has gone to the security sector. Three other countries — Nigeria, South Sudan and Congo — also received a waiver in 2015 despite using underage soldiers.

A State Department official, speaking on the condition of anonymity because of the sensitivity of the subject, said the waiver was granted so that the U.S. government could help Somalia develop its army and police and improve stability. “While more progress is needed, the government of Somalia has taken initial steps to implement its U.N.-backed child soldier action plan,” the official said.

She added that the State Department had “not heard reports” of the child informants.

In a letter last year to Sen. Ron Wyden (D-Ore.), CIA Director John Brennan addressed the question of how the agency reacts when one of its foreign partners is found conducting human rights abuses.

“If we determine that such abuses have occurred, we carefully assess whether national security imperatives warrant continuing contact” with the ally, Brennan wrote. If the relationship continues, he wrote, the CIA provides human rights training so the abuses are less likely to occur.

Critics say that in trying to crack down on a group linked to al-Qaeda, the United States and other donors have ignored human rights abuses.

Laetitia Bader, a Somalia researcher for Human Rights Watch, said the Obama administration’s decision to continue providing military aid “sends exactly the wrong message not only to the Somali army, but to all Somali security forces, that they can continue to use children without any consequences to their relationship with the U.S.”

In Mogadishu, as the former child combatants await their release from the Elman Center, they have a strong sense of what will come next: retribution.

“Once you’re labeled as an informant, there’s nothing for you. Where can you go?” said one 17-year-old, who said he had worked with the intelligence agency since he was 14.

One boy who was released and tried to return to his neighborhood was shot at by insurgents and returned to the center, Elman said.

“Some children are in such great danger because of their time as informants that we have to relocate them and their families to new regions,” Elman said.

When the boys imagine their future, they think about the way people treated them during their days as informants.

“You can feel all the hatred. The revenge that person wants on you. But you don’t have a choice,” said one 17-year-old boy with spiky hair and wide brown eyes, nicknamed Madowe.

His parents live in a part of the country under partial control of insurgents.

“I have no future in Somalia,” he said. “I have no faith that I can live while al-Shabab is in the country.”

Greg Miller and Carol Morello
in Washington contributed to
this report.