DOHA, Qatar — When the United States invaded Afghanistan in 2001 and toppled the Taliban government, even those who surrendered were treated as terrorists: handcuffed, hooded and shipped to the American detention camp in Guantánamo Bay, Cuba.
Now, in a stark demonstration of the twists and contradictions of the long American involvement in Afghanistan, five of those men are sitting across a negotiating table from their former captors, part of the Taliban team discussing the terms of an American troop withdrawal.
[To follow the Afghan war peace negotiations, sign up for the weekly At War newsletter.]
“During our time in Guantánamo, the feeling was with us that we had been brought there unjustly and that we would be freed,” said one of the former detainees, Mullah Khairullah Khairkhwa. “But it never occurred to me that one day there would be negotiations with them, and I would be sitting there with them on one side and us on the other.”
The five senior Taliban officials were held at Guantánamo for 13 years before catching a lucky break in 2014. They were exchanged for Sgt. Bowe Bergdahl, the only known American service member to be held by the insurgents as a prisoner of war.
In recent months, as the American and militants took up intense negotiations to try to end the conflict in Afghanistan, the Taliban leadership made a point of including the former prisoners. Each day during the recent round of talks in Doha, Qatar, the five men sat face to face with American diplomats and generals.
During days of slow and at times frustrated discussions at the most recent session, which ended on March 12, it was the Taliban side that was often more emotional. Some gave impassioned speeches about how vital it was that the Americans completely leave Afghanistan in as little as six months.
The usual response from the American side, led by the senior envoy Zalmay Khalilzad, was to give detailed technical explanations about why withdrawing was complex and needed to be slower, perhaps over years.
But other than Mullah Khairkhwa, the former detainees seemed more reluctant to speak, officials involved in the talks said.
When they did address the group, they seemed less harsh or strident than some of the other Taliban negotiators, perhaps mellowed by years of hardship or wary that their freedom could be fragile. Over the past few years, they have stayed in Doha and have been reunited with their families, but remain under watch by the Qatari authorities at the request of the United States.
The five former Guantánamo detainees had varying roles during the Taliban government. Mullah Khairkhwa served as a governor and acting minister of interior. Abdul Haq Wasiq was deputy minister of intelligence.
Perhaps the most infamous figure in the group is Mullah Fazel Mazloom, a front-line commander who was also chief of the Taliban army. While accusations of human rights abuses by the others have generally remained vague, there seems to be considerably more evidence against Mullah Mazloom, who is accused of mass killings and scorched-earth brutality.
During his tribunal hearings at Guantánamo — the transcripts were released by WikiLeaks — Mullah Mazloom (his last name means “meek”) showed no remorse.
“There is a 25-year war between person to person, village by village, city by city, province by province, and tribe against tribe,” he told the tribunal. “If you think this is a crime, then every person in Afghanistan should be in prison or bring them here.”
Still, he insisted: “I never fought against the new government. I never fought against America.”
In their introductions around the table as negotiations started last month, the five men held up their detention at Guantánamo as the most important part of their identity.
“In important moments like this, my own personal troubles don’t come to mind,” Mullah Khairkhwa said in the interview, after the negotiations had ended. “I am really not thinking about who is sitting across from me and what they had done to me.”
“What is important is what we are talking about,” he said, “and what is in it for our interests, for our goal and for our country.”
The men’s Guantánamo files include several notations about uncooperative behavior and instigations, including throwing milk at guards and tearing up their mattresses in protest.
Listed in Mullah Khairkhwa’s record, along with making disruptive noises or refusing to eat or shower at times, is this: trying to kill himself and urging others to kill themselves. But in his tribunal hearing, Mr. Khairkhwa denied having done so.
“There was no spoon in my meal, so I asked the guard for a spoon,” Mullah Khairkhwa said, according to the transcript. “Other detainees also shouted that they did not have spoons, either. The sergeant said he was sorry and from orders of his boss he could not provide me with a spoon.”
“When I asked the reason,” Mullah Khairkhwa added, “he said that I was trying to kill myself and encourage others to do the same.”
[See the Times interactive project “The Guantánamo Docket,” a collection of documents and research about the roughly 780 people who have been detained there.]
Most of the men were detained and sent to Guantánamo after they had surrendered — or even after they had started cooperating with the leadership of the new government the United States had installed in Afghanistan.
At the time of his arrest, Mullah Khairkhwa had retreated to private life in his family’s home village, and had reached out to President Hamid Karzai, who came to power in the wake of the American invasion.
Mullah Khairkhwa, according to his Guantánamo documents, was accused of narcotics trafficking and of closely associating with Osama bin Laden’s men in Al Qaeda. He denied both accusations in his hearings.
The former Taliban government deputy intelligence chief, Mr. Wasiq, had come to a meeting with C.I.A. operatives to discuss cooperation with American and Afghan officials. But he and some of his associates who had come along were bound and taken away, with at least one of them rolled up in a carpet.
Mullah Mazloom had surrendered to Gen. Abdul Rashid Dostum, an Uzbek strongman in northern Afghanistan whose militia allied with American Special Operations forces. General Dostum sent thousands of Mullam Mazloom’s men to an overcrowded prison, and his militia killed hundreds — if not thousands — of those foot soldiers after an insurrection in the prison.
Mullah Mazloom and some others were eventually turned over to the Americans.
A timeline for an American withdrawal from Afghanistan has been a stubborn sticking point during the long days of talks. But an even more frustrating issue has been how to define who is a terrorist and who is not. That definition is central as the United States has tried to seek assurances from the Taliban that Afghan territory will not again be used as a staging ground for terrorist attacks against the United States and its allies.
When they were toppled and hunted down, the Taliban were an oppressive regime, denying citizens basic rights, including keeping women and girls out of school and behind house walls. In the group’s 18-year insurgency since, they have resorted to acts of terrorism like truck bombings that have caused mass civilian casualties.
But now that the United States’ priority has shifted to withdrawal, and out of the pragmatic need to negotiate with the Taliban, American envoys have turned to parsing words to find some definition of terrorism they can hold in common with the Taliban.
In some of the sessions sitting across the table from the former Guantánamo detainees was Gen. Austin S. Miller, the commander of the American and NATO forces in Afghanistan, in his four-star uniform. Last October, General Miller narrowly escaped death in an attack by a Taliban infiltrator that killed a prominent Afghan security chief, Gen. Abdul Raziq, who had been walking beside him in a heavily guarded compound in Kandahar Province.
According to several officials on both sides who knew details of the talks, General Miller told the Taliban that he respected them as fighters, but that the war needed to end. He also evoked a mutual need to fight the terrorism of the Islamic State.
“We could keep fighting, keep killing each other,” General Miller was quoted as saying. “Or, together, we could kill ISIS.”
Mullah Khairkhwa said that even though the two sides had not been able to reach a final agreement this time, the two sides shared a common interest, at least, in ending the war.
“It’s been a long war, with lots of casualties and destruction and loss,” he said. “What gives me hope is that both teams are taking the issue seriously. On every issue, the discussions are serious, and it gives me hope that we will find a way out — as long as there are not spoilers to ruin it.”