Media playback is unsupported on your device Media caption Donald Trump: "It was my idea to terminate meeting"

US President Donald Trump says talks with the Taliban aimed at ending the 18-year war in Afghanistan are "dead".

"As far as I'm concerned, they are dead," he told White House reporters on Monday.

Over the weekend Mr Trump cancelled secret plans to host a Taliban delegation in the US after the militant group admitted killing a US soldier.

The two sides had appeared close to a deal and the Taliban said the US would "lose the most" for cancelling talks.

The US president has made withdrawing US troops from Afghanistan a key foreign policy aim, but asked about the 14,000 US troops still there he said: "We'd like to get out but we'll get out at the right time."

Mr Trump had been due to host the Taliban as well as Afghan president Ashraf Ghani at the Camp David presidential retreat before abruptly cancelling.

"They thought that they had to kill people to put themselves in a little better negotiating position", he told reporters, calling the attack "a big mistake".

What did Mr Trump say?

"We had a meeting scheduled. It was my idea and it was my idea to terminate it. I didn't even discuss it with anyone else," Mr Trump said as he departed the White House for a political rally in North Carolina.

"I cancelled Camp David on the basis that they did something that they sure as hell shouldn't have done," he said, condemning the attack that killed 12 people, including the US soldier.

Media playback is unsupported on your device Media caption Tens of thousands of Afghan soldiers have been killed and injured. This is their story

Mr Trump has been criticised for entertaining the possibility of hosting the Taliban just days before the anniversary of the 11 September attacks.

But Mr Trump defended the idea, saying "having meetings is a good thing, not a bad thing".

The Taliban had never agreed to end their violent campaign against Afghan and foreign forces while negotiations were taking place. Sixteen US troops have been killed this year.

In 2001, US-led forces overthrew the Taliban government in Afghanistan because the militants had given safe haven to the al-Qaeda network to plan the attacks on the US on 11 September.

How far did the talks get?

In a statement, Taliban spokesperson Zabihullah Mujahid said the talks were going well until Saturday.

Pulling out of the peace process before the signing of the agreement - because of one explosion - showed the US's lack of maturity and experience, he added.

The proposed meeting in the US came after nine rounds of talks between the US and Taliban representatives, held in Doha, the capital of the Gulf state of Qatar.

Media playback is unsupported on your device Media caption Is peace with the Taliban possible?

On Monday, the top US negotiator said there was a peace deal "in principle".

As part of the proposal the US would have withdrawn 5,400 troops within 20 weeks, in return for Taliban guarantees that Afghanistan would never again be used as a base for terrorism.

The Taliban is now in control of more territory than at any point before the 2001 US-led invasion. They have refused to hold direct talks with the Afghan government until a timetable for US troop withdrawals is finalised.