The Taliban veterans he contacted were skeptical. Despite their public insistence that they employ vast ranks of infiltrators within the Afghan Army and the police, they acknowledged that many of the insider attacks they take credit for start as offers by angry young men like Mahmood. They had seen many fail, or lose their nerve before even starting, and they figured that Mahmood, too, would prove more talk than action or would die in the attempt.

“Even the Taliban didn’t think I would be able to do this,” Mr. Mahmood said in an interview.

He proved them wrong days later, on the morning of May 11, when he opened fire on American trainers who had gone to the outpost in the mountains of Kunar Province. One American was killed and two others were wounded. Mahmood escaped in the ensuing confusion, and he remains free in Kunar after the Taliban welcomed him into their ranks.

It was, he said, his “proudest day.”