DOHA, Qatar — After years in which efforts at resolving America’s longest war ambled slowly forward, if at all, they now appear to be galloping toward the finish line.

American and Taliban negotiators are thought to be close to a deal that would see the 14,000 American troops remaining in Afghanistan return home, after they lost more than 2,400 of their ranks and had thousands more maimed.

But the Trump administration’s rush to withdraw will leave Afghanistan at the mercy of an extremely ascetic Islamist movement that has done little to change its ways since the U.S. invaded nearly 18 years ago.

“I think that at the beginning they were arrogant,” said Sohail Shaheen, a senior Taliban spokesman, referring to the American-led armies that toppled the Taliban after the militants sheltered the author of the Sept. 11, 2001, attacks, Osama bin Laden.

“I think now they understand, you know, the ground realities … that it is a meaningless war.”

Shaheen spoke to NBC News in Doha, the capital of the glittering Gulf Arab kingdom of Qatar, where U.S. and Taliban negotiators are deep into the seventh round of talks.

U.S. and Afghan soldiers take a knee near a U.S. Army Chinook near the town of Walli Was in Paktika province Nov. 1, 2012. Goran Tomasevic / Reuters file

On two crucial issues — respect for women’s rights and recognition of Afghanistan’s U.S.-backed government in Kabul — Shaheen either hewed to Taliban policies dating back decades before the U.S. invasion or deferred to further negotiations or future decisions by Islamic courts.

In an hourlong interview in one of the city’s finest hotels, Shaheen projected the calm confidence not only of a diplomat but of an experienced commander who would rather not have to blacken your eye but will do so if you need to be taught a lesson.

“That’s why we told the Americans at the beginning of the war, it’s not a picnic,” he said. “There will be a time that you will come to seek peace but that will be after a lot of loss on both sides, and that happened.”

The war has taken a devastating toll.

Nearly 18 years after a U.S.-led coalition toppled the Taliban government in Kabul, Afghanistan remains one of the poorest and most insurgent-ridden countries in the world — just like America and its allies found the country when they invaded in 2001. According to the Pentagon, the war is costing U.S. taxpayers around $45 billion a year.

Some 45,000 Afghan police and troops have been killed in the past five years, according to the Afghan government. In the last decade, 32,000 civilians have died, and a further 60,000 were injured, according to the U.N.

The future of women’s rights, one of the highest profile issues around the negotiations, has been largely left out of the American demands of the Taliban before the troop withdrawal.

American negotiators have to leave that question to “intra-Afghan” talks between the Taliban and the U.S.-backed government in Kabul, according to people familiar with the negotiations, and will likely make the status of women a factor in future economic aid to the desperately poor country.

“We've been clear that success or failure of the bilateral relationship and Afghanistan's relationship with the international community including the donor community will rest in part on what Afghans do to maintain the civil rights of women and minorities and preserve the gains of the last 18 years,” said Secretary of State Mike Pompeo last month, without defining what those “gains” had been.

In public, the Taliban have guaranteed women’s rights to education, health care and freedom to work insofar as it complies with Islamic law — a nebulous assurance that seems to ensure that the status quo persists.

“They will have all their rights. Whether it is right for education or it is right for work, they will have it according to Islamic rules,” Shaheen said. “So there will be no problem with that.”

Shaheen said women are educated under Taliban rule and do work, even though no women have been represented in the Taliban’s own negotiating team.

Once the Americans leave, women under Taliban rule would be obliged to wear a hair-covering hijab, rather than the body-covering burka, Shaheen said.

Such comments are typical of Taliban rhetoric, said Ashley Jackson, a research associate at the Overseas Development Institute, a London think tank.

The Taliban has never explicitly forbidden women from going to school or work. Instead, they’ve faulted the American occupation for sapping teaching resources or endangering women in public — a conceit that has covered all manner of misogynist abuse for decades, she said.

Afghan refugee women wait at the UNHCR registration center in the Pakistani city of Peshawar on June 19, 2017. Abdul Majeed / AFP - Getty Images file

“The U.S. and other actors have not pushed the Taliban hard enough on guarantees on women’s rights,” Jackson said. “We have gotten away with some very symbolic gestures about giving women rights under Islam.”

When pressed whether the Taliban would continue to stone women to death for adultery or flog them in the streets, Shaheen demurred, saying those decisions would be taken by Islamic scholars after the hostilities end.

On the U.S.'s most important and, in many ways, only demand — that Afghanistan never again shelter terrorists intent on attacking Americans — the Taliban are also equivocating.

While they have repeatedly said the country will never again be used as a base to launch attacks in other countries, they have not publicly withdrawn support for al Qaeda, which while greatly weakened is still thought to operate in pockets of the country.

The Taliban has long distanced themselves from al Qaeda, and Shaheen insisted the group doesn’t know the location of the terror organization’s surviving elements, such as leader Ayman al-Zawahiri.

Neither side has stated publicly exactly what guarantees or actions they want from the Taliban or what the Taliban will be willing to give.

Members of the Afghan delegations gathered in Doha on July 8. Karim Jaafar / AFP - Getty Images

Even if they wanted to, it is unlikely that the Taliban could keep a promise to rein in foreign fighters and groups. The central government in Kabul has always struggled to control the rest of the country, and it’s unclear if the Taliban could succeed where previous governments have failed.

The element of the talks that has caused the most delay, according to people with knowledge of the negotiations, remains the status of Afghanistan’s U.S.-backed government.

Despite rapid progress, the peace talks have paused as Zalmay Khalilzad, a former U.S. ambassador and the current lead negotiator, nudges the Taliban to negotiate directly with the Kabul government. That’s the missing piece that stands in the way of Pompeo’s stated goal of inking a deal by Sept. 1.

“I think part of this is around buying time so that the inter-Afghan process can move forward,” Jackson said. “The stumbling block is that the U.S. can’t withdraw troops until there is some kind of political process that means once the troops are withdrawn, the war won’t escalate.”

The Taliban has refused to hold formal peace talks with the government of President Ashraf Ghani, although they have held icebreaker-type dialogue attended by various Afghan political figures and civil society activists.

Shaheen left plans for what he called an “inclusive government” to subsequent and as-yet unscheduled intra-Afghan negotiators.

How he and other Taliban leaders envision such a government seems contradictory: Shaheen and the Taliban seem to want to defeat the Afghan government while also saying they want to include them in a future agreement.

“It is not a legitimate government,” he said of the U.S.-backed regime in Kabul. “It is supporting the U.S. occupation in Afghanistan, so a legitimate government would be when it is brought about by the intra-Afghan negotiations.”

A soldier inspects an Afghan man on motorcycle near Tagab in Kapisa Province on Jan. 25, 2011. Joel Saget / AFP - Getty Images file

The Taliban have yet to outline what they envision a post-war government might look like. Would they, for example, take part in elections? Would they want to see a new constitution, or amend the old one?

Until then, the Taliban will continue to fight the Americans and the U.S.-backed Afghan military without declaring a cease-fire. In fact, both the Americans and the Taliban have escalated hostilities since peace talks began with both sides jostling for a better position at the table.

“We seek a cease-fire,” Shaheen said. “But before the announcement of a timeline of troop withdrawal, how can it be possible? … That is tantamount to laying down arms, so no one will accept that.”

Instead, fighting will continue alongside talks, heaping mistrust on a process that has marinated in cynicism since it began.

But that doesn’t seem to bother Shaheen, who believes his Taliban are more than capable of fighting the Americans for yet another 18 years.

“If this generation does not succeed, another generation would come to succeed in order to put an end to the occupation,” he said. “So the sooner we end this, the better for both sides.”

Matt Bradley and Mushtaq Yusufzai reported from Doha, Dan DeLuce and Abigail Williams from Washington, and Ahmed Mengli from Kabul.