The US and Afghanistan’s Taliban left the door open for fresh talks after US President Donald Trump abruptly cancelled a secret summit, but the insurgents threatened to inflict greater costs.

Washington also said it would not relent in fighting the militants after Trump blamed the scuttling of the unprecedented meeting on a Taliban attack that killed a US soldier.

Trump said he had invited Taliban leaders and Afghan President Ashraf Ghani for talks on Sunday at the Camp David presidential retreat on a draft deal that would see the US withdraw thousands of troops and wind down its longest-ever war.

In a series of television interviews, US Secretary of State Mike Pompeo did not rule out a return to talks but said the US needed a “significant commitment” from the Taliban.

“I’m not pessimistic,” Pompeo told NBC.

“I’ve watched the Taliban do things and say things they’ve not been permitted to do before.”

“I hope it’s the case the Taliban will change their behaviour, will recommit to the things that we’ve been talking to them about for months,” he said on ABC.

“In the end, this will be resolved through a series of conversations,” he added, urging the Taliban to drop their long-running refusal to negotiate with Ghani’s internationally recognised government.

He said that Trump had not decided whether to go ahead with a withdrawal, which under the draft deal would pull 5,000 of the roughly 13,000 US troops from Afghanistan next year.

But Pompeo warned that the US was “not going to reduce the pressure” on the Taliban, saying US forces had killed more than 1,000 insurgents in the past 10 days alone.

Veteran US negotiator Zalmay Khalilzad, who had spent a year meeting with the Taliban, said that Trump showed “neither experience nor patience”.

“Americans will be harmed more than any other” by Trump’s decision, warned a statement by Taliban spokesman Zabihullah Mujahid.

But he added that the Taliban still believed “that the American side will come back to this position” of talks that seek “the complete end of the occupation”.

The office of Ghani, whose government is rejected by the Taliban as illegitimate, cautiously saluted the “sincere efforts of its allies” after Trump called off the summit.

The Afghani presidency in a statement also insisted that “real peace can only be achieved if the Taliban stop killing Afghans and accept a ceasefire and face-to-face talks with the Afghan government”.

Trump’s dramatic about-face came weeks ahead of Afghanistan’s presidential elections, raising fears that the Taliban will step up their campaign of violence to disrupt voting.

The idea of inviting Taliban leaders to US soil still stunned Washington.

The would-be talks even angered some Trump allies, who noted that the Taliban would be visiting three days before the 18th anniversary of September 11, which triggered the US invasion of Afghanistan.

“Camp David is where America’s leaders met to plan our response after Al-Qaeda, supported by the Taliban, killed 3,000 Americans on 9/11.

“No member of the Taliban should set foot there. Ever,” tweeted Liz Cheney, a Republican congresswoman and daughter of former US vice president Dick Cheney.

Considering Trump’s penchant for bombast, some questioned if the summit was even set to take place.

“I’m still looking for confirmation an actual, physical trip to Camp David was planned,” Democratic presidential candidate Julian Castro said, adding: “It’s very odd to invite a terrorist organisation like that to Camp David.”