The last time a foreign power withdrew troops from Afghanistan, peace talks collapsed and the Taliban dragged the body of the country's former president through the streets in a gruesome public execution.

U.S. negotiators seeking to end America's longest war are trying to reassure current President Ashraf Ghani this time will be different as they near a framework agreement with the Taliban, which controls about a third of the country's territory. It's not going well.

"Peace talks with a minority group of Taliban behind locked doors won't succeed," Ghani told a group of 2,500 youths in Kabul on Wednesday, according to a statement from his office. "We are thirsty for peace at the earliest opportunity, but it should be sustainable so your children can't be victimized by violence again."

Ghani's apprehension shows the difficulties President Donald Trump faces as he looks to withdraw some 14,000 American troops without plunging Afghanistan into a similar period of chaos that led to the Taliban's rise in the 1990s. After losing more than 2,300 U.S. soldiers and spending more than $900 billion in Afghanistan since 2001, the U.S. risks losing hard-won gains — particularly regarding women's rights and freedom of speech.

"A worst-case scenario could mean a rushed and irresponsible exit leaving the Taliban and other violent groups dominant," said Omar Samad, a former Afghan Ambassador to France and Canada now based in Washington. That would "lay the ground for chaos," he said.

Over recent months, Trump has stepped up efforts to make the political case for withdrawing troops from Afghanistan and other places like Syria. In a tweet on Wednesday, he said negotiations with the Taliban were "proceeding well."

The U.S. and the insurgent group struck "agreements in principle on a couple of very important issues" during talks in Qatar, Zalmay Khalilzad, the Trump administration's special envoy on Afghan reconciliation, said in a statement this week. That includes a Taliban pledge not to allow terrorists to use Afghanistan as a base, the withdrawal of U.S. and NATO forces, a cease-fire and direct Afghan-Taliban talks. Another meeting is set for February.

In an interview with Afghanistan 1TV on Jan. 28, Khalilzad said the U.S. did not plan to walk away from Afghanistan and leave "behind a void that leads to a civil war like before" — a reference to the Soviet withdrawal in 1989. "We want to have a long-term relationship with Afghanistan," he said. "That relationship should have different aspects: economic, social, political and security."

Still, it's not clear what a power-sharing agreement would look like -- and that's what has officials in Kabul worried. Former Taliban officials say discussions have been held on the establishment of an interim administration that would facilitate direct talks between the insurgent group and the Afghan government before an election. Ghani, however, has flatly rejected that idea.

"The Taliban has long rejected the Afghan political system as we know it, and has sought to overthrow it," said Michael Kugelman, deputy director of the Asia Program at the Wilson Center. "The notion of the group suddenly agreeing to share power and contest elections seems hard to believe."

Worse for Trump, the Taliban are negotiating from a position of strength that all but assures the group a key role in any new governance structure. Attacks have recently spiked across the country, including a strike on a compound belonging to the country's intelligence agency that killed 47 Afghan soldiers.

Ghani's government found its control over the country slipping further in the final months of 2018, according to the latest assessment by a Pentagon watchdog. It controls territory holding about 64 percent of the Afghan population as of Oct. 31, down about 2 percent from the previous quarter.

Many of Afghanistan's 35 million people just want to see the war end. It's killed more than 100,000 Afghans, displaced millions and forced many to flee abroad since 2001.

"Afghans are thirsty for peace and tired of violence," said Ahmad Shokur, a senior member of the Afghanistan Institute for Civil Society. "The talks for the first time ever have given people optimism and hope."

Still, Ghani has good reason to be nervous about a shoddy peace deal. He has warned that his government will not repeat the mistakes of former President Najibullah, who was murdered by the Taliban when it overtook Kabul in 1996, seven years after Soviet forces withdrew.

After being briefed by Khalilzad this week, Ghani called on the Taliban to hold serious and immediate direct talks with the Afghan government. The militant group has long rejected similar requests because they view his U.S.-backed administration in Kabul as illegitimate.

CIA Director Gina Haspel said "a very robust monitoring regime" would be necessary under a potential peace accord. "It's very important that we maintain pressure on the terrorist groups" in Afghanistan and retain the ability to act against them, Haspel said in testimony Tuesday to the Senate Intelligence Committee.

"All players must act cautiously as a hasty deal wouldn't produce a sustainable solution," said Waheed Mujhda, a former Taliban official who is now a Kabul-based political analyst. "The rights of women and most importantly freedom of speech will be potentially at risk."

