An American soldier killed in Afghanistan this summer wasn’t yet 3 when the war began. Seventeen years after 9/11, America still seems determined to keep fighting.

“We were in Darwin, Australia, training, and it was actually the first night that we got to go out” on the town, Dailey, who was the platoon sergeant for the force reconnaissance platoon for the 15th Marine Expeditionary Unit, told me recently. He and his men had finished training and were preparing to get back on their boat.

John Dailey recalls the events of September 11, 2001, well.

“We were in Darwin, Australia, training, and it was actually the first night that we got to go out” on the town, Dailey, who was the platoon sergeant for the force reconnaissance platoon for the 15th Marine Expeditionary Unit, told me recently. He and his men had finished training and were preparing to get back on their boat.

“We were all sitting in a pub in Darwin with soccer games on TV,” he said. “Suddenly, they switched over to images of the World Trade Center in flames, and we knew it wasn't going to be a routine deployment.”

They were at sea the next morning. A few weeks later, Dailey says, they were in Pakistan to secure some areas. By November, they were in Afghanistan. Tuesday marks 17 years since Dailey and his men watched the Twin Towers of the World Trade Center come down in New York—and soon it’ll be as long for the U.S. military involvement in Afghanistan that came shortly afterward.

The U.S.-led invasion of Afghanistan in October 2011 quickly evolved from a mission to capture or kill Osama bin Laden and al-Qaeda’s leadership to one in which the focus became fighting the Taliban (while conducting clandestine operations inside Pakistan to hunt for al-Qaeda’s leadership). Seventeen years and tens of billions of dollars later, the conflict is at a stalemate: At least as long as the U.S. remains in the country, the Afghan government will remain in charge even as the Taliban continues to showcase its ability to carry out attacks seemingly at will. The duration of that war, and the U.S. war in Iraq, has meant repeated deployments for some U.S. military personnel, the psychological cost of which the Army was already warning about a decade ago. One of the most recent American fatalities in Afghanistan, from just this month, was on his seventh combat deployment. The continuation of the conflict, now nearly a generation long, also means that people who can’t even remember the attacks are old enough to deploy—a 20-year-old soldier killed in Afghanistan this summer wasn’t yet three years old on September 11, 2001. Soon people who weren’t even born then will be old enough to go fight.

But the U.S., buoyed by an unprecedented Eid ceasefire along with direct U.S.-Taliban talks, now hopes that it can force the Taliban into a dialogue with the Afghan government. “We have more indications that reconciliation is no longer just a shimmer out there, no longer just a mirage,” James Mattis, the U.S. defense secretary, said last week ahead of a visit to Afghanistan. “It now has some framework, there’s some open lines of communication.” General John Nicholson, who until recently headed the U.S. military effort in Afghanistan, said this month while handing over command that “it’s time for this war in Afghanistan to end,” as he urged the Taliban to enter into peace talks, adding: “Until you are willing to begin talking, we will keep fighting.”

Supporters of the continued U.S. military involvement in Afghanistan have cited various reasons for it: that it remains in the national interest; that it is vital to prevent the resurgence of international terrorism; and that it gives the U.S. a geopolitical foothold in the region. Each of those arguments has its own counterargument: that the mission has veered so far from its original intent and sucked up so many resources that it actually harms the national interest; that if preventing terrorism from gaining a foothold is the rationale to remain, then the U.S. should deploy an equal number of troops to Libya, Mali, and Yemen; and that Afghanistan is of such vital interest to Russia, China, Iran, Pakistan, and India that keeping U.S. troops there puts them in the in the crosshairs of complicated regional regional rivalries.

But Karl Eikenberry, a retired U.S. Army lieutenant general who was U.S. ambassador to Afghanistan from 2009 to 2011, and commander of U.S. forces there before that, said there is also a moral argument about why the U.S. should remain.

“That’s the one that should be debated the most. For 17 years, we’ve been telling the Afghan people—women, minority groups, and youth— that America will stay in the fight until there is a sustainable peace,” he told me. “Because of the fiscal and geopolitical opportunity costs, it is not in our national interest to remain, and we can reasonably tell ourselves that we’ve done enough. But when we do pull out, we’ll leave behind unfulfilled promises and human tragedy for which we will be culpable.”

The current U.S. policy in Afghanistan has been guided by the Trump administration’s South Asia strategy, which was announced last August. It calls for bombing the Taliban while pushing the militant group to talk with the Afghan government, and simultaneously exerting pressure on Pakistan, which is believed to have some influence over the Taliban. The U.S. says it will remain in the country until the Afghan government takes full control of its territory. That could take some time: The Kabul government controls about 65 percent of the country’s districts, according to the Special Inspector General for Afghanistan Reconstruction, a congressionally appointed watchdog that oversees the U.S. effort in the country, including most of its population centers, but the Taliban remains firmly in control of the rural areas and about 12 percent (the rest are contested). This policy, which President Trump assented to despite his own reservations about keeping troops in Afghanistan, is the latest in several strategies the U.S. has tried in the country.

U.S. policy in Afghanistan can be broadly divided into four phases: The first phase, which followed the September 11 attacks, was focused narrowly on the defeat of al-Qaeda and the Taliban, which refused to turn bin Laden over to the U.S. At the time, the U.S. and the international community believed that the Taliban was a spent force and that, while the effort to rebuild Afghanistan would be long and expensive, it would be ultimately successful. That proved a flawed assumption: The Afghan government found the business of governance difficult; corruption and lack of accountability were rife. The U.S. support for warlords with dubious reputations—and sometimes out and out track records of severe human rights violations—didn’t help matters, nor did the difficulty of building Afghan security forces. And, perhaps equally significant, the Taliban proved much more resilient than anyone expected, with Pakistan giving its fighters both sanctuary and assistance.

“The U.S. military entered Afghanistan with the well-defined mission to destroy al-Qaeda and topple the Taliban government. Most assumed that the subsequent tasks of state-building and economic development in Afghanistan would be lengthy but not prohibitively expensive,” Eikenberry said. “By 2004-2005, the Taliban had reconstituted inside of Pakistan and were waging an increasingly lethal insurgency campaign against a weak Afghan government unable to assert control of its sovereign territory. Our initial assumptions were proving terribly flawed.”

By 2006-2007, the U.S. moved toward a counterinsurgency strategy, combined with a robust effort toward state-building. But by this time, the war in Iraq was raging. “We discussed the ways to address the mounting problems [in Afghanistan], but had insufficient means available,” Eikenberry said. “The resources were allocated to Iraq as a matter of priority. Afghanistan, in military parlance, had become an ‘economy of force’ operation.” As Admiral Mike Mullen, the chairman of the Joint Chiefs of Staff, succinctly put it in 2007: "In Afghanistan, we do what we can. In Iraq, we do what we must.”

There was another policy shift following the election of Barack Obama in 2008. Obama had campaigned on getting out of Iraq and finishing the job in Afghanistan. The president was skeptical of the options given to him by the Pentagon, which involved more U.S. troops and a conditions-based withdrawal. Obama did send more troops to the country, but set a time limit for how long those roughly 100,000 troops would remain: He wanted most of them out in 2011. In May of 2011, after a team of U.S. Navy SEALs killed bin Laden, Obama was able to withdraw the troops he’d sent to Afghanistan as part of the surge, leaving 5,000 in the country to assist Afghan security forces. But Obama’s desire to declare an end to the war in Afghanistan was met with the reality of not only the Taliban’s resilience, but also the appearance of ISIS in Afghanistan.

Trump took office in January 2017, announced his South Asia Strategy in August of that year, and increased the number of U.S. troops in Afghanistan to about 14,000. Since then, the U.S. has continued its airstrikes against the Taliban, even as the militants have continued to seize territory, and stage dramatic and fatal attacks. But this period has also seen a historic three-day ceasefire between the Afghan government and the Taliban, as well as direct talks between a high-level U.S. official and the Taliban in Qatar. U.S. officials appear to be optimistic about the current situation—even if 17 years after the 9/11 attacks Afghanistan is no closer to a reconciliation process, let alone a total U.S. troop withdrawal. Then again, U.S. officials have sounded optimistic on this score before. In 2011, David Petraeus, the NATO commander, said the war had turned a corner. Obama went even further, saying the “tide of war was receding.” Neither of them was wrong—it was just that the conflict found a way of coming back.

Asked recently whether the U.S. was maintaining a permanent presence in Afghanistan, James Mattis, the defense secretary, said: “We are there in order to ensure that America's security—and just think back to 9/11 and this building—is not threatened out of that location. That involves the Afghan people being in control of their own future. This is why we talked about an Afghan-led, Afghan-owned reconciliation process. And we believe that the best way to get there is to ensure Taliban recognizes they can't win on the battlefield, they must negotiate.”

And then he added: “Now, would we still have troops in Afghanistan five years from now? I can't give you the answer to that.”

Unless the president changes his mind, the U.S. military involvement is likely to continue in the country for at least the next few years. Any negotiations between the Taliban and the Afghan government will take years and could be easily derailed by high-profile attacks in Afghanistan or interference from across the border in Pakistan. The Afghanistan war is already by far the longest U.S. military engagement in history, and it has come at the cost of the lives of more than 2,000 U.S. military personnel, not to mention the civilian death toll in Afghanistan from the fightingand airstrikes with more than 10,000 people killed in 2017 alone.In many ways, the duration of the engagement might be due to Afghanistan’s place in the American imagination—the place from which terrorists planned and carried out a dramatic attack on the U.S. homeland, an attack that arguably has reshaped the U.S. worldview over the past 17 years. But some Americans overseas at that time have a different view of the events of September 11.

As Dailey, the platoon sergeant, told me: “I think the thing that really struck, even now beyond the anniversary, I think I feel less impacted by it than those who were here. Experiencing it—I think the whole nation experiencing [the tragedy] collectively ... we were removed and spared a lot of that. I think that’s the feeling I always had. September 11th, I really had a much different viewpoint than everybody ... we were a world away. … I remember it so differently.”