In a series of tweets, President Donald Trump "called off" a planned secret meeting between him and Taliban leaders.

The cancellation throws into doubt nearly a year of US-Taliban talks as the US tries to extricate itself from a nearly 20-year war.

Visit Business Insider's homepage for more stories.

KABUL, Afghanistan (AP) — With a series of tweets, President Donald Trump has upended nearly a year of US-Taliban negotiations on ending America's longest war.

He has "called off" the talks and asserted that a planned secret meeting between him and Taliban leaders at Camp David, set for Sunday just days before the 9/11 anniversary, is now canceled. Some question whether it was a face-saving attempt after the deal his envoy said had been reached "in principle" faced serious challenges.

The Taliban took half a day to respond, saying the abrupt decision hurt US credibility after they had "finalized" a deal, but said the US likely would return to negotiations. The two sides had still been talking on Saturday, they said — two days after Trump said he had "immediately" called off talks.

Here's a look at the push for a deal that Trump had wanted quickly, calling it "ridiculous" that the US was still in Afghanistan after nearly 18 years and billions of dollars spent.

The Taliban, who ruled Afghanistan with a harsh version of Islamic law from 1996 to 2001 and hosted Osama bin Laden as he masterminded the 9/11 attacks, say they no longer seek a monopoly on power. But the militant group now controls or holds sway over roughly half of the country.

Many fear a full withdrawal of some 20,000 NATO troops would leave the weak and corrupt Afghan government vulnerable to collapse, or unleash another round of fighting in a war that has killed tens of thousands.