US Army soldier is show firing a howitzer weapon, the exhaust of which has made piles of rocks fly on opposite sides of the artillary.

US Army soldiers from the 2nd Platoon, B battery 2-8 field artillery, fire a howitzer artillery piece at Seprwan Ghar forward fire base in Kandahar province in southern Afghanistan, 2011.

Credit:

Baz Ratner/Reuters

The Washington Post’s "Afghanistan Papers" paint a picture of a long-running quagmire: A war without a defined objective waged against an unclear enemy and a battlefield strategy deeply out of touch with ground realities. US officials have long known the war was unwinnable, and they systematically concealed this from the US public.

The most painful implication to emerge from The Afghanistan Papers, however, is that the US is to blame for its own defeat. The Taliban now control vast swaths of the country. They have done so by systematically capitalizing on Afghan dissatisfaction with the international community's broken promises, government corruption fueled by misspent aid, and abuses committed by pro-government forces.

The failure to establish a functioning justice system is a prime example. Despite devoting millions of dollars in funding to building the Afghan justice system, state courts are profoundly corrupt and ineffective. The Taliban’s sharia courts, known for their brutality as much as their efficacy, have filled the void. I've interviewed Afghan government officials who, although opposed to the Taliban, have sought justice in Taliban courts because they felt it was their only option.

Related: US spending in Afghanistan fueled rampant corruption, reports say

The international community and Afghan government often tout advances in education, but corruption and dysfunction in state schools created another opportunity for the Taliban. The Taliban has assumed control of US-funded state schools in areas under their control, forcing teachers to show up for work and punishing students who misbehave. The failure to create security and viable governance has been so abysmal that, for many Afghans, the Taliban — widely reviled while they were in power in the 1990s — now look to some Afghans like a preferable alternative.

Largely absent from the debate spurred by The Afghanistan Papers is a serious discussion about what to do next.

The US government now concedes that a political settlement with the insurgency is the only way to stop the violence. Talks between the US and the Taliban have now resumed, after being abruptly called off by President Donald Trump via Twitter in early September. At the time talks were halted, the US Special Representative for Afghan Reconciliation Zalmay Khalilzad and the Taliban had reached a tentative deal. The US reportedly promised to withdraw most of its forces in exchange for a Taliban pledge to cooperate on international terrorism and start peace talks with the Afghan government. The key issue left to agree upon is a mutual pledge to reduce violence.

While an agreement may be close at hand, the US government must figure out how to deal with a minority chorus of domestic dissent. The loudest critics have been Senator Lindsey Graham and David Petraeus, formerly the leader of US and NATO forces in Afghanistan, who claim the deal will sell out the Afghan government and present a grave risk to US national security. They argue that the Taliban can’t be trusted, and that Afghanistan will again become a hotbed of international terrorism. What they haven’t offered is an alternative, aside from continuing the war indefinitely.

Throughout the course of the war, hawks within the US government have successfully argued for an escalation and expansion of the war on similar grounds. They have repeatedly insisted that more troops, more money or more airstrikes will turn the tide. They have, of course, been loudly and consistently wrong — but have rarely been called to account. The violence has intensified each year, with the Afghan government losing more ground and the Taliban only getting stronger. It's been said that insanity can be defined as doing the same thing repeatedly and expecting a different result. This aptly describes the United States’ Afghanistan strategy.

Related: Amb Lute on the war in Afghanistan: The US is 'taking a very hard look at itself'

The challenge now will be to assure critics that an agreement will preserve both the Afghan government and the gains made over the past 18 years. That will be a tough sell. A US-Taliban agreement won’t end the Taliban’s war against the Afghan government, and that government is increasingly fractured and dysfunctional. The results of Afghan presidential elections held in October still have not been announced. Another problem is low turnout and widespread fraud, which would immediately call into question the mandate of any resulting government.

A decisive election result is unlikely and a political settlement, similar to the one brokered by then-US Secretary of State John Kerry in the last presidential election, will almost certainly be required. Yet the prospects of such an agreement are currently dim. The two leading contenders, President Ashraf Ghani and Chief Executive Abdullah Abdullah, are increasingly at odds with one another. Ghani has rejected calls for a transitional government to include all factions. Fearing a Ghani victory, Abdullah has effectively blocked a full vote recount, and his allies have staged protests across the country.

Even if the US secures a deal with the Taliban, and even if the Taliban agree to enter into talks with the Afghan government, the Afghan government’s interest in negotiating with the Taliban is unclear. Recent briefings from Afghan security officials have alluded to the fact that they still believe they can defeat the Taliban, so long as the US continues its support. It’s as though the Afghan government, which relies on foreign forces for its survival and international aid for 75% of its budget, assumes the US will prop it up indefinitely.

The full weight of missed opportunities is crushing.

Had former Defense Secretary Donald Rumsfeld not rebuffed the efforts of Mullah Omar and other Taliban officials to surrender after the US invasion in 2001, the Taliban insurgency might have never emerged. Had negotiations started with the Taliban in 2011 moved forward instead of collapsing, there might have been a chance to preserve Afghan democracy. Had the military establishment focused more of its energy on getting the war right than cultivating the false appearance of progress, far fewer lives would have been lost on all sides.

Despite the dire state of affairs, it is not too late to change course. A deal with the Taliban is the best chance the US has of extracting itself from the morass. To be sure, ensuring Afghanistan does not become a failed state yet again will require US support. But the US strategy moving forward should not be dominated by the military; it must instead prioritize robust diplomatic engagement and smarter aid. An end to US military engagement will not end the United States’ responsibility to both the American and Afghan people, to account for what went wrong and chart a more responsible course.

Ashley is a research associate with the Humanitarian Policy Group at the Overseas Development Institute and has a decade of experience working on the ground in humanitarian crises and on policy issues.