KABUL, Afghanistan — Even as President Trump blamed a recent Taliban attack for his decision to call off nearly year-long negotiations with the insurgents, officials suggested on Sunday it had more to do with the Taliban’s resistance to the American terms for a peace deal.
Talks that once seemed on the verge of a breakthrough had hit a wall over how the deal should be finalized and announced, they said.
With the president himself showing more engagement in the talks in recent weeks, the Trump administration had set in motion a daring gambit: Fly the insurgents’ leaders and the Afghan leader, Ashraf Ghani, to American soil.
At Camp David, the traditional retreat of many presidents, separate meetings with each side would then lead to a grand announcement by Mr. Trump, according to Afghan, Western and Taliban officials with knowledge of the peace talks.
The Taliban leaders, however, having refused to negotiate directly with the Afghan government until after the group had an agreement with the United States, had compared the proposal to the Americans’ tricking them into political suicide. The Americans were also rushing to finalize outstanding issues, including disagreements over prisoner release, before the meeting at Camp David.
“We promised there would be intra-Afghan talks once we finalized our agreement with the Americans,” a senior Taliban leader said. “If Trump and his administration think they would solve the confrontation between the government and the Taliban somewhere in Washington in a meeting, that’s not possible because we do not recognize the stooge government.”
For his part, Mr. Ghani, a skeptic of the American negotiations that left out his government, had agreed to the risky Camp David visit in the hopes of finding a way to end a period of great uncertainty for his country.
The Afghan president was signing up for nothing less than a gamble, with the details of what might transpire at Camp David vague even to his closest circle of advisers. But stuck in a difficult position, he didn’t have much to lose, a senior official said.
After the talks were called off, the Afghan government blamed the Taliban, saying that the violence was making the peace process difficult. Sediq Sediqqi, a spokesman for Mr. Ghani, lashed out at the Taliban’s political office in Qatar, saying that the group had shown no commitment to peace despite having protection in the Gulf country and freedom of movement.
“The Taliban’s honeymoon in Qatar needs to be ended,” Mr. Sediqqi said.
It recent weeks, it had been increasingly clear that the United States and the Taliban, after nine rounds of painstaking negotiations over nearly a year, had ironed out most of the issues between them. The chief American envoy, Zalmay Khalilzad, declared that the agreement document had been finalized “in principle.”
That deal, criticized by Afghan officials for lacking measures that would ensure stability, would include a timeline of about 16 months for a gradual withdrawal of the remaining 14,000 American troops, with about 5,000 of them leaving in 135 days after its signing. In return, the Taliban would provide counterterrorism assurances to ease American fears of repeat of attacks on home soil — such as the attacks by Al Qaedaon Sept. 11, 2001, that precipitated the war in Afghanistan.
The final rounds of negotiations — and even Mr. Trump’s invitation for a summit meeting at Camp David — had occurred during a period of intensifying violence, including the killing of American soldiers. In response to the Taliban attacks, the American negotiators had made clear that they were prioritizing the finalization of the agreement, not a boycott of the talks. Their negotiations were also undergirded by increasing battlefield pressure by the American military on the Taliban.
But just how the deal would be announced remained unclear, and competing demands made it even more complicated. Those demands included Mr. Trump’s election promise of ending the Afghan war, the Taliban’s sensitivity about not fracturing their forces, the Afghan government’s need to be seen as having the support of its main ally and sponsor, and Qatar’s wish to get credit for hosting the long-running talks at a time when neighboring countries have ganged up on it in by a blockade.
At the end of August, just as the ninth round of talks was winding down in Doha, the American ambassador arrived at the Afghan presidential palace with the proposal of a Camp David meeting, Afghan officials said. The visit would take place soon after a national security meeting led by Mr. Trump.
Details of the trip to the United States were sorted out between the Afghan president and the American side, when Mr. Khalilzad arrived from Doha and held four rounds of talks with Mr. Ghani. A plane would arrive to take Mr. Ghani and his delegation of about a half-dozen senior officials to the United States.
Mr. Ghani’s ministers knew they would be meeting with their American counterparts and that a Taliban delegation would most likely be arriving, too. But they were unclear on the details of how it would all come together. They had to be prepared on all three issues that were their government’s priority: the presidential elections scheduled for Sept. 28, how the peace talks would move forward to include them and how they would continue to bolster their security forces in a way that would reduce the cost for the United States.
As a sign of how important the event was for the United States, Mr. Ghani got the Americans to agree to include on the trip his national security adviser, Hamdullah Mohib, who had essentially been kept out of the American meetings for months after lashing out at the peace process.
For months, the Americans had essentially held Mr. Ghani’s re-election campaign hostage to a deal that they projected was imminent. Mr. Ghani was reduced to pretending that the September elections were still on by holding a couple of daily “virtual rallies” at which he addressed small gatherings around the country via video chat. If the American-Taliban deal were finalized, it would most likely push the elections back.
If Mr. Ghani had refused the Camp David meeting, he would have been called a spoiler of peace. So he took his chances; it was to be hosted by an ally on friendly turf, and it could help clarify whether there would be a peace deal, and whether the elections would proceed.
One senior Afghan official said the government had been in a difficult place for months: fighting a war while trying to find a way into peace talks and preparing for an election both as a government that holds it and as a candidate that contests it.
Now, the official said, two things were clear: The violence would intensify, and the elections would go ahead.