If the United States’ longest foreign war actually draws to a negotiated close, a significant amount of credit will go to a former U.S. Army colonel and a former senior U.S. diplomat.

In November, Chris Kolenda and Robin Raphel boarded a plane to Doha, Qatar, for a conversation with Taliban representatives. It was the beginning of a quiet channel, never authorized by U.S. officials—who neither paid them nor asked them to carry any messages—that proved to be instrumental in convincing the Trump administration, and particularly senior Pentagon and U.S. military officials, that there was a real chance to broker an end to the war.

Kolenda, an Afghanistan veteran himself, had been here before. He had been part of an ultimately fruitless attempt during the Obama administration to talk with the Taliban. But this time, talking with the Taliban in Doha, “I was struck by what I detected was a much higher level of seriousness about bringing the conflict to a close than I saw in 2011,” Kolenda told The Daily Beast.

“ They said that if an inclusive government... wants [U.S.] forces to be in the country... the Taliban said they would be OK with that. ” — Chris Kolenda

That seriousness was manifested through Taliban leaders showing pliability about the future of the U.S. troop presence. Despite their strident public position that U.S. troops must withdraw, the Taliban communicated to Raphel and Kolenda that there were circumstances under which they can envision living with a continued American military presence. And they again vowed that an Afghanistan open to Taliban political participation would not host a foreign terrorist presence, satisfying the central U.S. objective of the 17-year war.

“We were able to vigorously challenge their viewpoints, and didn’t just accept what the Taliban told us,” Kolenda said. “They said that if an inclusive government, after a political settlement occurs in Afghanistan, wants international forces to be in the country to train Afghan security forces, the Taliban said they would be OK with that, because they’ll have participated in that decision.”

Over nine months, Kolenda and Raphel shuttled back and forth between Washington and Doha three times and, last month, added Kabul to their itinerary. The Daily Beast can reveal the existence of their informal diplomacy now that it’s led to Alice Wells, a senior State Department official holding the South Asia portfolio, meeting with Taliban officials in Doha on July 23 in the first U.S.-Taliban talks for seven years.

Those talks were just “preliminary,” according to a Taliban official, and Kolenda is quick to note that all the hard decisions, including on the fate of U.S. troops, are ahead. But as recently as June, the Trump administration was downplaying any prospect of direct talks with the Taliban, saying only that the U.S. was prepared to facilitate and contribute to talks between the U.S.-backed Afghan government and the Taliban.

“The American government’s position has evolved,” said Raphel, who acknowledges that her quiet, informal diplomacy was one factor among many. “They finally came to accept that it really is a stalemate. While the Taliban can’t win in a traditional way, we can’t win either.”

Several developments among Afghans themselves, especially a pivotal ceasefire and nationwide peace marches, led to this new burst of diplomacy. But “Chris and Robin were really useful in elevating these issues to a young administration that hadn’t been steeped in the history of the Afghanistan peace process,” said Johnny Walsh, a U.S. Institute of Peace scholar and a former State Department official who is himself steeped in Afghan peace efforts.

“ The U.S. government’s position has evolved. They finally came to accept that it really is a stalemate. While the Taliban can’t win in a traditional way, we can’t win either. ” — Robin Raphel

This isn’t the first time U.S. officials have tried direct talks with the Taliban. In 2011, the Obama administration tried outreach as a way to marry their troop surge to a diplomatic settlement. But talks collapsed before gaining any traction, done in by early leaks and opposition from then-U.S. military commander David Petraeus. The result was that an already arduous military campaign had no path to a resolution.

The war continued on as American administrations changed. While every military officer and senior U.S. official professed publicly that there was no military solution to the conflict, they acted as if there were, even as the Taliban racked up battlefield successes from 2015 to 2017.

But the Taliban were less isolated than it seemed. With a political office in Doha, the Taliban fielded quiet diplomatic outreach from a variety of interlocutors, both governmental and private. Among the private channels was one from the anti-nuclear Pugwash Conferences, which over the years held forums in Doha, Dubai, and Kabul. The key figure keeping a line open to the Taliban in Doha was Pugwash’s secretary general, Paolo Cotta-Ramusino, an Italian quantum physicist who, for five years, kept a line to the Taliban open, searching for an opportunity.

Cotta-Ramusino knew Raphel “for many years,” he said, with Raphel attending several Pugwash conferences. A retired ambassador, Raphel was a major figure in regional diplomacy. She was the first State Department assistant secretary for South Asia who had extensive Pakistani contacts—and was a known quantity to the Taliban.

Cotta-Ramusino was convinced in October 2017 that there was an opening for peace among the Taliban. Raphel, who thought it was worth exploring, wanted to have the credibility of a senior U.S. military officer who had fought in Afghanistan, believed in peace, and to whom the military establishment was likely to listen.

Kolenda fit the bill. He was an adviser to Obama-era Undersecretary of Defense Michele Flournoy and onetime Afghanistan war commander Stan McChrystal. The former Defense Secretary Robert Gates had even tapped Kolenda as his representative for the aborted 2011 Taliban talks. Kolenda’s experience in Afghanistan is both representative of 17 years of war and unique within it.

Like hundreds of thousands of fellow veterans, Col. Kolenda knew the cost of the Afghan conflict: He lost four of his soldiers in Kunar and Nuristan in 2007 and 2008. They include Maj. Tom Bostick, whom Kolenda visited last week at Section 60, Gravesite 8755 of Arlington National Cemetery. But, unusually for a man with his background, Kolenda has for years, and with passion, urged U.S. officials to pursue a diplomatic settlement to overcome the high-level inertia that has kept the war going on autopilot.

“He was appearing on various panels around town talking perfectly good sense, and not a whole lot of people were,” Raphel said.

Kolenda talks about the pursuit of peace with the Taliban as an obligation, not an afterthought or a pipe dream.

“I’m responsible for the death of hundreds on hundreds on hundreds of these dudes. I have never lost a wink of sleep because I know we were doing the right thing in the right way,” he said. “But violence is not an end in itself. When your adversary is ready to accept your war aims, then I think you’ve got an obligation to pursue a serious way to end the war.”

“ The Taliban don’t want the [American] troops, but if there are enough guarantees that the troops aren’t fighting them, then it can be discussed. ” — Paolo Cotta-Ramusino

The Taliban’s positions in their talks with Raphel, Kolenda ,and Cotta-Ramusino were, at most, evolutions of their previous stances—often dismissed by Americans—rather than wholesale transformations. But they heard an urgency from the Taliban. Taliban officials said they feared Afghanistan becoming a “second Syria,” surely mindful of the rise of an Islamic State presence there siphoning adherents and political power from the Taliban.

The Taliban’s public position is—and remains—that the foreign military occupation of Afghanistan must end as a precondition for negotiations. But privately, the Taliban indicated an extraordinary flexibility, and even a theoretical openness to a residual U.S. troop presence.

If the U.S.-backed Afghan government amended the constitution, opened up the political system, and accepted Taliban participation, the Taliban negotiators said, they would entertain the idea that the resulting government could invite U.S. forces to stay. Those American troops could continue training Afghan soldiers—including, hypothetically, ex-Taliban commanders. At that point, they said, it wouldn’t be an occupation. They were even open to hosting U.S. surveillance listening posts.

The Taliban, Cotta-Ramusino said, can put the troop-presence question inside a broader “framework for agreement” on continued international aid. But to reverse their public position on expelling foreign troops before that framework would risk a rank-and-file revolt that threatens the Taliban’s ability to deliver on their promises.

“They don’t want the troops, but if there are enough guarantees that the troops aren’t fighting them, then it can be discussed,” Cotta-Ramusino said.

Between the lines, the Taliban also seemed to recognize that “the days of their late-Obama-era battlefield gains are over,” as Kolenda put it.

The Taliban were anticipating that Donald Trump would pull out of Afghanistan. When he didn’t, reluctantly accepting former National Security Adviser H.R. McMaster’s approach to stay indefinitely with a modest increase in U.S. forces, the Taliban, Kolenda concluded, got a sense that their leverage had reached a high point, and they wanted to lock it in—all while warning that Afghanistan was a powder keg that could blow during elections in 2019.

“They were thoughtful and serious,” Raphel said. “They had reflected, as anyone would, on their time in power and that they’d made some serious mistakes.” Raphel continued: “They say that they do not want any foreign terrorist groups on Afghan soil and won’t let Afghan soil be used in that way.”

From Kolenda’s perspective, all that meant the Taliban were willing to live with the core interests—no terrorism, stability under an inclusive and legitimate government, human-rights protections, curbing the narcotics trade—that the U.S. had been futilely fighting to secure.

But skepticism in Washington about the Taliban ran high, as did habituation to such a long war. Kolenda and Raphel encountered it when briefing administration officials after their trip. During a follow-up visit in Doha in January, which Cotta-Ramusino couldn’t attend, the Americans urged the Taliban to make a public statement that signaled their willingness for diplomacy on terms the U.S. could accept.

On Feb. 14, the Taliban delivered. Their statement was characteristically strident, referencing the “inexperienced policies of President Trump and his warmonger advisers.” But the Taliban also said, publicly, that it had “no agenda of playing any destructive role in any other country” and “will not allow anyone else to use Afghan territory against any other country.” Its main message was that it was time for dialogue with the United States.

Yet the Taliban was still waging war. At the end of January, the Taliban took responsibility for a massive suicide bomb, hidden in an ambulance, that killed 100 people in Kabul, the capital that only sporadically experiences the violence that the war has brought to the hinterlands.

Within two weeks of the Taliban statement, the U.S.-sponsored Afghan president, Ashraf Ghani, made his own overture. Ghani promised to enter into a peace process with the Taliban “without preconditions,” and offered the Taliban recognition of their legitimacy as a party to the conflict, another Taliban goal. He even floated a ceasefire to underscore his seriousness, despite the recent suicide bombing. Reuters noted it was a “change in tone for Ghani, who has regularly called the Taliban ‘terrorists’ and ‘rebels.’”

“ The Taliban was talking reconciliation—but still waging war. At the end of January, the Taliban took responsibility for a massive suicide bomb, hidden in an ambulance that killed 100 people. ”

But while the two statements seemed to represent momentum for peace, they pointed to a diplomatic logjam. The Taliban reject Ghani’s government as a puppet and prefer to deal with its American patron. Ghani, with vocal American backing, positioned himself as the central figure. A bilateral U.S.-Taliban negotiation could undermine a government Washington has spent 17 years backing as the legitimate voice of Afghanistan. “There was a standoff,” Raphel said.

Within the Trump administration, there was also strong skepticism that the Taliban could deliver on the promises they heard via Kolenda and Raphel. For years, U.S. officials have held that the Taliban are a decentralized umbrella group of factions, rather than a united force. The impact of that conventional wisdom is to render diplomacy pointless, since it was unknown if Taliban interlocutors actually spoke for anyone else. A procession of military officers, for the better part of a decade, have preached fracturing the Taliban through “reconciliation” efforts, despite their dismal track record.

Still, Kolenda, Raphel, and Cotta-Ramusino returned to Doha in May for another parley with Taliban figures who gave them the same message—we want to talk to the Americans—as in November and January. Once again, when they returned to Washington, they continued to brief the administration on the Taliban’s thinking. “We would brief Defense Department officials after each engagement—here in D.C. as well as in Kabul. The senior leadership, we kept them very well informed with verbal updates as well as written readouts,” Kolenda said.

Not long after came the breakthrough.

On June 5, Ghani unilaterally announced a Ramadan ceasefire as a peace gesture. The U.S. military commander in Afghanistan, Gen. John Nicholson, immediately backed it, even though he didn’t know how the Taliban would respond. The Taliban’s response was seismic: Four days later, they ordered their own ceasefire—applied to Afghans, not U.S. forces—for the Eid holiday.

What emerged was an outpouring of joy and solidarity around the country. Afghan soldiers took selfies with their Taliban adversaries. Ordinary Afghans that month undertook massive peace marches from war-torn Helmand province to Kabul, hundreds of miles distant, demanding a durable peace between the government and the Taliban.

But the real sea change was taking place 7,000 miles away. The Taliban, contrary to years of received Pentagon wisdom, had just proven they had the ability to order and enforce the ceasefire, meaning they had centralized control over their fighters. If that was true, it meant there was someone the U.S. could talk to—if the administration was willing.

The diplomatic logjam, however, remained. The U.S. couldn’t afford to undercut Ghani. But on June 16, Secretary of State Mike Pompeo made a gesture of his own. He didn’t offer unilateral talks, in keeping with a U.S. mantra that all negotiations be “Afghan-led.” But he said that “the United States is prepared to support, facilitate, and participate in” discussions between the Taliban and the Afghan government.

It was still a step short of an agreement for U.S.-Taliban talks, but it was movement in that direction—even though the Taliban, after the ceasefire ended, killed 30 Afghan soldiers and days later followed up with another wave of deadly attacks that killed 16 more. Despite the bloodshed, the Pentagon—which declined to comment for this piece—was warming to a direct dialogue.

The Taliban backing of the Eid ceasefire had, by late June or early July, created what Kolenda called “enthusiasm” for peace talks. Secretary of Defense Jim Mattis, Chairman of the Joint Chiefs of Staff General Joseph Dunford, Central Command chief General Joe Votel, and Nicholson now wanted to get talks moving, and quickly—cognizant both of the extreme length of the war and that there would be no additional resources from Trump for waging it.

“ I’m responsible for the death of hundreds on hundreds of these dudes. I have never lost a wink of sleep because I know we were doing the right thing in the right way... But violence is not an end in itself. When your adversary is ready to accept your war aims, you’ve got an obligation to pursue a serious way to end the war. ” — Chris Kolenda

Skepticism from the State Department subsided when the united Pentagon support coalesced. But there was continued hesitation from some officials: Wouldn’t a U.S.-Taliban dialogue undermine Ghani?

Wells, the acting assistant secretary of state for South and Central Asia, came up with a formulation that overcame the final bureaucratic opposition. The U.S. could engage in “talks, not negotiations.” It sounds like a distinction without a difference, but there was substance to it. The U.S. would explore with the Taliban mechanisms to kickstart a peace process to which Washington would contribute under Afghan auspices. But it wasn’t negotiating the future of Afghanistan—that would be up to the Afghans themselves.

The State Department declined to answer specific questions for this piece. But a spokesperson provided a statement that seemed to echo the concept of U.S.-Taliban talks but not such negotiations over far-reaching issues impeding on Afghan sovereignty: “Our policy is to support an Afghan-led peace process. Any negotiations over the political future of Afghanistan will be between the Taliban and Afghan government. As Secretary Pompeo said in Kabul: ‘United States will support, facilitate, and participate in these peace discussions, but peace must be decided by the Afghans and settled among them.’ The United States stands ready to do so as requested by the government of Afghanistan.”

Kolenda, Raphel, and Cotta-Ramusino boarded another plane on June 23. This one wasn’t headed to Doha, but to Kabul. They spent the next week talking to some 40 different Afghans, including major figures like Ghani, chief executive Abdullah Abdullah, former President Hamid Karzai, and even the warlord and insurgent chief Gulbuddin Hekmatyar, who entertained the Americans at his Kabul villa. They heard, by and large, enthusiasm for the peace process and a sense that the U.S. needed to help break the diplomatic logjam inhibiting it.

Publicly, the U.S. still insisted there was no change in the works. But the Pentagon was already preparing for the implications of a peace process. According to a U.S. official, Dunford and Votel started “internal advocacy” for a “path forward” to integrate Taliban fighters into the Afghan national security forces in the event that peace process sufficiently matures. The Pentagon is already preparing a day when its enemies and its clients functionally unite.

On July 23, Wells arrived in Doha to talk with the Taliban. Taliban officials have confirmed the meeting, which was first reported by The Wall Street Journal. Asked by The Daily Beast, the State Department sidestepped the existence of the meeting and has thus far only confirmed that Wells visited Doha on that date. But the overture had begun.

Everyone involved in the process emphasizes that it has barely begun. Every hard question about the future course of Afghanistan, and the U.S. presence within it, remains untested by the likely arduous diplomacy ahead. That diplomacy must contend with the scars of two generations of war in Afghanistan.

But it’s diplomacy among combatants. It’s not fighting indefinitely with little more than gestures at maybe finding a way out of conflict through training Afghans and gradually withdrawing, as if the Taliban are irrelevant to the future.

“It’s our responsibility and our duty to pursue a diplomatic solution to this conflict and the way things have evolved in the last year or so, it’s clear there is an opportunity. It’s our responsibility to seize it,” Raphel said. “We can’t stand by and let it pass, considering the number of Afghans, Americans, and others who have died in this war.”

And for Kolenda, the process ahead represents the closest thing the U.S. can call victory: an accord on the future of Afghanistan to secure war aims left over from the 9/11 attacks. “You’ve got to put personal animosities aside and look at what’s in the national interest,” Kolenda said. “It’s not easy to do. It’s not easy to put aside those personal feelings. But you’ve got to do it, in order, essentially, to win a war through a negotiated outcome. It’s an obligation.”