President Donald Trump tweeted Saturday that he canceled a secret meeting with Taliban leaders that was poised to be held at Camp David on Sunday.

In a series of tweets, Trump cited the death of a US soldier in a recent Taliban attack as his reasoning and said he's also canceling ongoing peace negotiations.

This came less than a week after his top negotiator in ongoing US-Taliban talks said a peace deal had been reached "in principle." The deal would see 5,400 US troops withdraw from five bases in Afghanistan within 135 days.

The withdrawal of any of the roughly 14,000 US troops in Afghanistan is up in the air as the longest war in US history drags on.

Visit Insider's homepage for more stories.

President Donald Trump said Saturday he canceled a secret meeting with Taliban leaders and that was scheduled to take place at Camp David the very next day.

Trump said he called off the meeting due to a recent Taliban attack that killed a US service member in Afghanistan.

"Unbeknownst to almost everyone, the major Taliban leaders and, separately, the President of Afghanistan, were going to secretly meet with me at Camp David on Sunday," Trump tweeted.

The revelation came less than a week after Trump's top negotiator in ongoing US-Taliban talks said a peace deal had been reached "in principle." The deal would have seen 5,400 US troops withdraw from five bases in Afghanistan within 135 days.

But the president said Saturday that in addition to canceling the secret meeting, he called off peace negotiations with the Taliban altogether, throwing into doubt the withdrawal of any of the roughly 14,000 US troops currently in Afghanistan.

Read more: America has no good options in Afghanistan and is negotiating with terrorists who continue to kill civilians and NATO troops

"Unfortunately, in order to build false leverage, [the Taliban] admitted to an attack in Kabul that killed one of our great great soldiers, and 11 other people," Trump tweeted. "I immediately cancelled the meeting and called off peace negotiations. What kind of people would kill so many in order to seemingly strengthen their bargaining position? They didn't, they only made it worse."

The president went on to say that if the Taliban cannot agree to a ceasefire during the talks "and would even kill 12 innocent people, then they probably don't have the power to negotiate in a meaningful agreement anyway."

Trump then questioned "how many more decades" the Taliban is willing to fight.

The US is struggling to end the longest war in its history

The war in Afghanistan, which began shortly after the 9/11 terror attacks, is nearly 18 years old and the longest conflict in US history.

As the Taliban continues to conduct deadly attacks in Afghanistan the Islamic State group (ISIS) has also gained a foothold in the country, which compounds the convoluted array of issues the US faces as it seeks to end its role in the long and costly war.

Read more: Most American veterans say the wars in Afghanistan and Iraq were 'not worth fighting,' as the US flexes its military muscles at Iran

A Taliban-claimed attack killed an American soldier in Kabul on Thursday, which occurred not long after a US Green Beret from Idaho was killed in the southeastern province of Zabul on August 29, The Washington Post reported. So far, 16 US service members have been killed in combat in Afghanistan in 2019.