A US soldier and a service member from Romania were killed in a car bombing in Kabul. (Representational)

The Taliban on Sunday said US President Donald Trump's abrupt decision to cancel peace talks would lead to fresh losses to American lives in Afghanistan at a time when the insurgent group was ready to finalise a deal to end the war.

The group issued a statement hours after Trump unexpectedly canceled talks with the Taliban's "major leaders" at a presidential compound in Camp David following the Taliban's claim of responsibility for an attack in Kabul last week that killed an American soldier and 11 others.

"Both sides (US, Taliban) were busy with preparation for the announcement and signing the peace deal, but now the US president called off the peace dialogue... this will lead to more losses to the US,," said Zabihullah Mujahid, a Taliban spokesman, said in a statement.

"Its (US) credibility will be effected, its anti-peace stance will be exposed to the world, losses to lives and assets will increase," he said.

"We will stay committed if the path of negotiation is chosen instead of fighting...we won't be satisfied until there is an end to the foreign occupation of our country," he said.

US diplomats have been talking with Taliban representatives for months seeking to agree to a plan to withdraw thousands of American troops in exchange for security guarantees by the Taliban.

Afghan President Ashraf Ghani, seeking a second tenure in twice-postponed elections scheduled for Sept. 28, urged the Taliban to end violence and talk directly to his government after Trump canceled the meeting.

"Real peace will come when Taliban agree to a ceasefire," Ghani's officials said in a statement in response to Trump's cancellation of the talks.

However the Taliban have so far refused to talk to the Afghan government, which they consider an illegitimate "puppet" regime.

Almost 4,000 Afghan civilians were killed or wounded in the first half of 2019 in the war against militant groups, including a big increase in the number of casualties caused by government and foreign forces, the United Nations said in July.

As negotiators reached a draft accord last week, Taliban fighters, who now control more territory than at any time since the war started in 2001, were launching assaults on the northern cities of Kunduz and Pul-e Khumri. They claimed responsibility for two major suicide bombings in the capital Kabul.

Trump's surprise announcement left in doubt the future of a draft peace accord worked out last week by Zalmay Khalilzad, the special US envoy for peace in Afghanistan.

Under the draft some 5,000 US troops would be withdrawn over the coming months in exchange for guarantees Afghanistan would not be used as a base for militant attacks on the United States and its allies.

A full peace agreement to end more than 18 years of war would depend on "intra-Afghan" talks involving officials and civil society leaders as well as further agreement on issues including the remainder of the roughly 14,000-strong US forces as well as thousands of other NATO troops.

CIVIL WAR

The Taliban's strategy of fresh assaults appears to be based on the assumption that battlefield success would strengthen their hand in future negotiations with US and Afghan officials.

Some of their field commanders have also said they are determined not to surrender gains when they are close to victory, suggesting the leadership is under internal pressure not to concede a ceasefire.

The warring sides have held nine rounds of peace talks in Qatar's capital city Doha aimed at ending America's longest war, which began with a US invasion triggered by the September 11, 2001 attacks in New York, that al Qaeda launched from then Taliban-ruled Afghanistan.

Nine former US ambassadors last week had warned that Afghanistan could collapse in a "total civil war" if Trump withdraws all US forces before the Kabul government and the Taliban conclude a peace settlement.

Trump said on Saturday that he had also planned to meet with Afghanistan's president, who has been sidelined from the talks.

Ghani's office said in a statement it was committed to working together with the United States and allies for a "dignified and long-lasting peace", and emphasised the need to hold the presidential election this month.

The Taliban want the elections to be canceled as a precondition to signing a peace accord with the Americans. In Kabul, uncertainty over peace deal and Taliban warnings to boycott polls had dampened election enthusiasm.

The European Union's special envoy for Afghanistan Roland Kobia said on Sunday presidential elections must be held this month as the country needs a political leadership that has received a renewed democratic mandate from its citizens.

"It seems today that the EU line advising preparation of elections in parallel and as if there was no Afghan peace process was not unwise. Elections become more necessary by the hour," Kobia wrote in a Twitter post.