SULAYMANIYAH, Iraq - As a journalist based in northern Iraq for the past six years, I've seen the war with the Islamic State closer than I'd like. In the summer of 2014, my best friend, a man I'd come to love and respect during my time reporting here, was taken prisoner by the militants. We were more like brothers than friends, and I haven't heard from him since.

I was filming about 180 miles away on the evening he disappeared. I dropped everything and drove through the night to join a small group of his friends and family. We formed an ad-hoc rescue team, and while the militants stormed west across Iraq, we worked exhaustively to find him. (I can't say more about him, because doing so could put him in further danger.) We were driven by rage and desperation.

Months later, Diji Terror, a Kurdish counterterrorism unit based in Sulaymaniyah, granted my request to interview one of its prisoners. Ali was seized during a nighttime raid caught on film: In the footage officials showed me, Diji troops handcuffed, blindfolded and bundled him off on a helicopter. Ali had beheaded Islamic State prisoners, they told me; I couldn't help but think of my friend. Finally, a small chance to press the Islamic State for answers about its tactics. A chance for some shred of catharsis.

Ali wore an orange jumpsuit and plastic sandals. He sat hunched in his chair as a guard lit a thin, white cigarette and passed it to him. He took it with both hands, his wrists cuffed together, and inhaled deeply. (In Islamic State territory, smoking is forbidden.) This sight was a far cry from an Islamic State propaganda photo of him dressed in black, standing commandingly behind a Kurdish peshmerga soldier he subsequently executed.

Ali said he was born in 1995 and joined the Islamic State in 2008, at the age of 13. He was trained as an assassin and was given his first mission two years later. He and three friends were sent to kill four Iraqi police officers in Mosul. The group tracked the men down, executed them with shots to the back of their heads and then buried them where they fell. Ali said he had killed eight or nine men in battle, not including the five he'd beheaded.

I asked him to tell me about it. In a soft, compliant voice, he told me he had pushed the Kurdish soldier belly-first onto the ground in front of him. He placed his knee in the man's back and then cut his head off with a bayonet. Did Ali have a message for the families of the peshmerga he'd beheaded? He went quiet for a second, and then his face screwed up very tightly and he began to sob.

Ali had indeed been a dangerous terrorist, and the world is safer with him behind bars. But Ali had also been a child soldier, a vulnerable boy coerced into becoming a terrorist. I interviewed many other fighters like him, some just 14 years old when the Islamic State came to their villages and compelled them at gunpoint to join.

The Islamic State continues to commit despicable acts of cruelty, but the men who carry out these crimes are not the two-dimensional caricatures they're painted to be. They are human beings, many indoctrinated at the most impressionable age and coerced into service.

A few weeks after the interviews, I saw a photo taken after a battle between the Kurds and the Islamic State near Sinjar, Iraq. In the lower left-hand corner is the body of a militant, his head just out of the frame, blood pooling by his left shoulder. His name is Abdul Aziz Faraj Yusuf, age 16. I've seen a lot of photos of dead Islamic State fighters, but as I reread the boy's age, I felt something different. Gone was the sense of retaliatory satisfaction. This was a dead child. I wasn't angry anymore. I was heartbroken.