In a Saturday evening bombshell, Trump said that he had planned unprecedented, albeit separate, talks with the two sides Sunday in Camp David, the presidential retreat in Maryland, but that the Taliban's persistent, grisly campaign of violence made them untrustworthy partners.
"Unbeknownst to almost everyone, the major Taliban leaders and, separately, the President of Afghanistan, were going to secretly meet with me at Camp David on Sunday," Trump said in a tweet.
....only made it worse! If they cannot agree to a ceasefire during these very important peace talks, and would even kill 12 innocent people, then they probably don’t have the power to negotiate a meaningful agreement anyway. How many more decades are they willing to fight?
"Unfortunately, in order to build false leverage, they admitted to an attack in Kabul that killed one of our great-great soldiers, and 11 other people. I immediately cancelled the meeting and called off peace negotiations."
"What kind of people would kill so many in order to seemingly strengthen their bargaining position? They didn't, they only made it worse!" Trump said.
Watch: Taliban Attacks Kunduz City, 7 people killed in clashes
A US soldier and another service member from Romania were killed in the car bombing Thursday in Kabul -- the latest major attack claimed by the Taliban even as they negotiated with a US envoy on the withdrawal of thousands of troops.
Trump would have met the Taliban at Camp David -- scene of secret 1978 talks as Jimmy Carter brokered peace between Israel and Egypt -- days before the 18th anniversary of the September 11 attacks, which triggered the US invasion that toppled the militants' regime.
Washington was jolted by the announcement from Trump, who is fond of dramatic gestures but whose Twitter pronouncements have often come into question later.
"The idea that Trump was planning to host Taliban leaders at Camp David is a rather big surprise," said Laurel Miller, who served as the US special representative on Afghanistan and Pakistan until early in the Trump administration.
"Why a lethal attack in Kabul on Thursday would be the reason for calling it off, considering the multiple recent Taliban attacks, is unclear," Miller, now the Asia director of the International Crisis Group, told AFP.
Congressman Tom Malinowski, a Democrat who has been pressing for clarity on the US strategy in Afghanistan, called the idea of Taliban leaders at Camp David "weird."
"And everyone knew they've been continuously committing terrorist attacks. But I'm glad the president called off this farce, and hope this good decision sticks," Malinowski tweeted.
Deal unpopular in Kabul
The announcement by tweet appears abruptly to end, at least for now, a painstaking diplomatic process led for nearly a year by Zalmay Khalilzad, the Afghan-born veteran US diplomat who held nine rounds of talks with the Taliban, usually in Qatar.
Afghanistan's internationally recognized president, Ashraf Ghani, had been outspoken in his criticism of the emerging shape of the withdrawal agreement with the Taliban, who have refused to negotiate with his government.
Selling the plan in Kabul, Khalilzad said that he had reached an agreement "in principle" with the Taliban -- who ruled much of Afghanistan from 1996 to 2001 during which they imposed a draconian version of Islam.
According to parts of the draft deal that had been made public, the Pentagon would pull about 5,000 of the roughly 13,000 US troops from five bases across Afghanistan by early next year.
The insurgents in turn would renounce Al-Qaeda, promise to fight the Islamic State group and stop jihadists using Afghanistan as a safe haven -- the primary reason for the 2001 invasion.
US public opinion has soured on nearly two decades of war and Trump, after initially being persuaded to reinforce US troops, has said that the United States should not pursue "endless" war.
Question mark on troops
Trump's announcement draws a fresh question mark on whether the United States will leave Afghanistan anytime soon.
The decision comes weeks before Afghanistan is set to hold elections, an unwieldy exercise even in more stable times.
Trump had been uncharacteristically reticent about Afghanistan in recent weeks, with all eyes on whether he would approve a final deal.
Washington had hoped that a withdrawal of US troops would lead to negotiations between the Taliban and Kabul on a more permanent peace.
The Taliban have shown no signs of letting up on violence. Claiming responsibility for Thursday's bombing, which shook a fortified central area of Kabul, Taliban spokesman Zabihullah Mujahid said that a "martyrdom seeker" -- or suicide bomber -- had killed "foreign invaders."
Trump has walked away from high-stakes talks before. In February, his aides pressed him not to accept a deal in Hanoi with North Korean leader Kim Jong Un -- another individual whom it would have long been unthinkable for a US president to meet.
But Trump soon made clear that he wanted to keep talking, calling Kim a friend, and arranged to meet him in June as the US leader visited the Korean peninsula.