WASHINGTON — President Trump said on Saturday that he had canceled a secret meeting at Camp David with Taliban leaders and the president of Afghanistan and had called off monthslong negotiations with the Afghan insurgent group that appeared to be nearing a peace agreement.
“Unbeknownst to almost everyone,” Mr. Trump wrote in a series of tweets, Taliban leaders and the Afghan president, Ashraf Ghani, were headed to the United States on Saturday for what would have been a historic Sunday meeting at Camp David.
But Mr. Trump angrily said that “in order to build false leverage,” the Taliban had admitted to a suicide car bomb attack on Thursday that had killed an American soldier and 11 others in the capital of Kabul. “I immediately cancelled the meeting and called off peace negotiations,” he wrote.
“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,” Mr. Trump wrote. “How many more decades are they willing to fight?”
Mr. Trump’s announcement was startling for multiple reasons. A surprise summit at Camp David with leaders of an insurgent group that has killed thousands of Americans since the October 2001 invasion of Afghanistan would have been a sensational diplomatic gambit, on par with Mr. Trump’s meetings with the once-reclusive North Korean leader, Kim Jong-un.
The move also appears to scuttle — for now — his longstanding hopes to deliver on a campaign promise to withdraw American troops.
The details of the meeting and exact timeline of its scheduling and cancellation, as described by Mr. Trump, were unclear on Saturday night. On Friday, the website of Radio Free Europe/Radio Liberty, citing an Afghan official, reported that Mr. Ghani had postponed a planned meeting in Washington.
It was also unclear whether Mr. Trump was calling a permanent halt to the peace negotiations. The president has frequently reversed himself in short order, and abruptly canceled his first summit with Mr. Kim before rescheduling it soon after.
Even more significant than the fate of the meeting is Mr. Trump’s assertion that he is calling off the peace negotiations that his special envoy for Afghanistan, Zalmay Khalilzad, began last winter. They were propelled by Mr. Trump’s impatience to withdraw American troops from an 18-year conflict that he has called an aimless boondoggle. United States and foreign officials said that the talks had reached an advanced stage and, until Saturday night, that an agreement with the Pashtun insurgent group that once harbored the Qaeda mastermind Osama bin Laden was close at hand.
In nine rounds of negotiations, Mr. Khalilzad painstakingly worked toward a final peace agreement that would be brokered between the Taliban and Afghan government officials and civil leaders.
Mr. Khalilzad has pledged to draw down American military troops in exchange for a partial cease-fire by the Taliban. In a recent interview with the Afghan channel ToloNews, he said 5,400 United States forces would leave Afghanistan within 135 days after the agreement is signed.
That agreement would only reduce the number of American troops to about what it was when Mr. Trump took office in 2017.
As for the remaining 8,600 American forces, Mr. Khalilzad said in an interview that they would leave after the early rounds of inter-Afghan negotiations had concluded, but he did not predict when that might happen or give a deadline for the troop withdrawal. Some American officials have suggested it could be within 16 months, right at the end of Mr. Trump’s first term in office, if the Taliban meet certain conditions.
That would allow Mr. Trump, who has been routinely critical of expensive American interventions in the Muslim world, to declare that he had ended a long conflict that has grown unpopular and obscure with the American public, and to boast that he had achieved an outcome his predecessor, President Barack Obama, sought in vain.
The reality could be more complicated. Mr. Trump has hinted that the United States would retain “strong intelligence” in the country, language that some experts believe to describe plans for a robust presence of armed C.I.A. operatives. And even if an initial deal with the Taliban were to be reached, its enforcement could face numerous pitfalls.
Critics of the nascent agreement — including the former American commander in Afghanistan, the retired Army general, David Petraeus — have warned that it could lead to the return of Al Qaeda, which used its safe harbor in Afghanistan to plot the Sept. 11, 2001, attacks, triggering the United States invasion and occupation of the country. Several have invoked the example of Mr. Obama’s troop withdrawal from Iraq, which allowed for the emergence of the Islamic State in Iraq and Syria.
Those critics have pointed to a continued high tempo of Taliban attacks as a sign that the theocratic insurgent group cannot set aside violence. The bombing cited by the president involved a car bomb detonated on Thursday at a checkpoint near the American Embassy in Kabul. It killed 12 people, including one American soldier.
Afghan government officials who have been briefed on the negotiations privately said Mr. Khalilzad did not force enough concessions from the Taliban to ensure stability as the American military leaves Afghanistan.
One official said the agreement between Mr. Khalilzad and the Taliban will not assure national elections on Sept. 28, as Mr. Ghani has demanded. Rather than requiring a nationwide cease-fire, it calls for a reduction of violence in Kabul and Parwan. And, the Afghan government official said, it may allow the Taliban to continue referring to itself in official conduct as the “Islamic Emirate” — as it did when the extremist group was ruling Afghanistan with fear.
If anything, said one Afghan official, the negotiations appear to have only emboldened the Taliban. The official spoke on the condition of anonymity to discuss the closed-door briefings more frankly.
“They are much more emboldened and they have a chance to take over,” the Afghan official said on Wednesday.