As we take the first major, halting steps toward a peace agreement in Afghanistan, all I can remember is how we got there in the first place. On 9/11, I was a newly promoted one-star admiral, working on the Navy staff in the Pentagon. My office was in the new section of the building, and I literally watched the airplane hit the Pentagon. As I stumbled out onto the grassy field below from the burning building, the irony of the moment struck me: here I was, in the safest building on earth, guarded by the strongest military in history, in the capital of the richest country in the world. If the Pentagon wasn’t safe, what was?

We all knew that everything would change, especially for those of us in the U.S. military. I was wrenched out of my comfortable assignment as a strategic budget officer and selected to lead “Deep Blue,” a hastily created think tank that was charged with charting a new course for the Navy in what would become known as the “War on Terror.” We didn’t really know what that meant, nor did we appreciate all that would unfold in so many places around the world, and how many would die as a result of our retaliation. But we did know that the plot that killed 3,000 Americans had begun in Afghanistan, and very quickly the focus of the U.S. military became going there, finding Al-Qaeda, and destroying them. The Taliban – who had harbored them – were at the time a small obstacle that we quickly overcame. As tens of thousands of U.S. troops deployed to a strange, foreboding nation whose geography seemed to resemble the surface of the moon we could never have predicted we were embarking on the longest war in U.S. history.

Over the nearly two decades to some, hundreds of thousands of US troops rotated through Afghanistan, generally on one-year assignments. At peak in 2013, there were over 150,000 U.S. and allied troops deployed there from over 50 nations. Many died, including nearly 2,500 killed and over 20,000 wounded. During my four years commanding the NATO mission “Enduring Freedom” there, I wrote 1,700 letters of condolences to grieving families, about a third of them Europeans. It was a hard time for the U.S. military, which was caught in a classic counter-insurgency battle against an implacable and determined foe. Some of the U.S. generals who commanded in country under my command included Stan McChrystal, David Petraeus, John Allen, and Joe Dunford – each was very capable and utterly determined. Yet progress was hard to define, and the frequent changes of command at every level in country hampered our efforts. We suffered from Pakistani-provided safe havens for the Taliban just over the border, difficult supply chains across inhospitable central Asian countries, and a tendency to emphasize positive developments while understating the challenges.

Despite the frustration and the casualties, we were able over time to turn the fight over to the marginally capable Afghan security forces – army, special forces, and police – and withdraw the vast majority of our troops. From the 150,000 I commanded in 2009-2013, we have brought home 90%, with only 13,000 or so still there—and dropping potentially to under 9,000 with the peace deal. Hopefully the peace agreement will be successfully concluded by Ambassador Zalmay Khalilzad’s tireless efforts – if so, he deserves the Nobel Peace Prize. With the week-long ceasefire seeming to hold, a preliminary agreement signed, and the tenuous next steps will be negotiations between the Afghan government of Ashraf Ghani and the Taliban. The objective from the U.S. perspective will be to bring home more of our troops, although ideally we would retain a cadre of special forces and trainers of perhaps 5,000 to help preserve the gains in democracy, human rights and gender equality that have been so painfully achieved. When I spoke with Zal about this a couple of weeks ago, he assured me the withdrawal would be “conditions based,” meaning we would not fully depart until the country was secured. How all that unfolds is difficult to predict.

We’ve seen this movie before, of course … in Vietnam. There it ended terribly, with all our forces withdrawn, funding cut to the Vietnamese Army, and helicopters lifting off the rooftop of the U.S. Embassy in Saigon. Many of our local allies of decades were tortured and killed in “re-education” camps. It doesn’t have to end that way again, but success will require: a modicum of funding for the Afghan security forces; maintaining a “conditions based” approach before withdrawing more troops; real dialog between the Afghan government and the Taliban; continuing rights for women; and engaging our allies in continuing financial and political support for the Afghans.

It will be hard to be sure, and the wheels could easily come off. I’d estimate the chances of a successful outcome – defined as the Taliban actually negotiate a long-lasting peace – at roughly 50-50. But we need to recognize that there is no military solution here, something that has only been broadly accepted – especially in the Pentagon – over the past couple of years as the Taliban have remained so resilient. It is often said, correctly, that Afghanistan is the “graveyard of Empires,” referring to failed campaigns of Alexander the Great, the British, and Russia. The good news is that we are not an empire, and do not desire strategic territory, permanent domination, or the natural resources of Afghanistan. But we have spent much blood and treasure into this honorable cause, and it would be foolish to throw it away.

Sign up for Inside TIME. Be the first to see the new cover of TIME and get our most compelling stories delivered straight to your inbox. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.