Our ultimate betrayal would come from Atiqullah himself, whose nom de guerre means “gift from God.”

What follows is the story of our captivity. I took no notes while I was a prisoner. All descriptions stem from my memory and, where possible, records kept by my family and colleagues. Direct quotations from our captors are based on Tahir’s translations. Undoubtedly, my recollections are incomplete and the passage of time may have affected them. For safety reasons, certain details and names have been withheld.

Our time as prisoners was bewildering. Two phone calls and one letter from my wife sustained me. I kept telling myself  and Tahir and Asad  to be patient and wait. By June, our seventh month in captivity, it had become clear to us that our captors were not seriously negotiating our release. Their arrogance and hypocrisy had become unending, their dishonesty constant. We saw an escape attempt as a last-ditch, foolhardy act that had little chance of success. Yet we still wanted to try.

To our eternal surprise, it worked.

ON Oct. 26, 2008, I arrived in Afghanistan on a three-week reporting trip for a book I was writing about the squandered opportunities to bring stability to the region. I had been covering Afghanistan and Pakistan since 2001 and was inspired by the bravery and pride of the people in those two countries and, it seemed, their popular desire for moderate, modern societies.

The first part of my visit proved depressing. I spent two weeks in Helmand Province, in southern Afghanistan, and was struck by the rising public support for the Taliban. Seven years of halting economic development, a foreign troop presence and military mistakes that killed civilians had bred a deep resentment of American and NATO forces.

For the book to be as rigorous and fair as possible, I decided that I needed to get the Taliban’s side of the story.

I knew that would mean taking a calculated risk, a decision journalists sometimes make to report accurately in the field. I was familiar with the potential consequences. In 1995, I was imprisoned for 10 days while covering the war in Bosnia. Serbian authorities arrested me after I discovered mass graves of more than 7,000 Muslim men who had been executed in Srebrenica.

My detention was excruciating for my family. Promising I would never put them through such an ordeal again, I was cautious through 13 subsequent years of reporting.