Peter Bergen is CNN's national security analyst, a vice president at New America and a professor of practice at Arizona State University. He is completing a book about President Trump's national security team and policies and has reported from Afghanistan for CNN since 1993. The opinions expressed in this commentary are his own. View more opinion articles at CNN.

(CNN) On Saturday, President Donald Trump tweeted that "the major Taliban leaders and, separately, the President of Afghanistan, were going to secretly meet with me at Camp David on Sunday." Trump then said that he had "cancelled the meeting and called off peace negotiations" because the Taliban had "admitted to an attack in Kabul that killed one of our great soldiers."

Trump can smell a bad deal when it is presented to him, and the deal that US Secretary of State Mike Pompeo and his lead US-Taliban negotiator, Zalmay Khalilzad, is cooking up with the Taliban is a real stinker.

First, it's just not possible to pick a worse moment to be cozying up to the Taliban.

Consider that photos of Taliban leaders meeting with Trump at Camp David would have landed on front pages everywhere as the United States commemorates the 18th anniversary of the 9/11 attacks on Wednesday. The Taliban, of course, sheltered Osama bin Laden and al-Qaeda for years after they had attacked two US embassies in Africa in 1998 and a US warship in Yemen in 2000 -- and again after the 9/11 attacks as well.

Second, however, you dress it up, Khalilzad is negotiating a withdrawal agreement with the Taliban, not a peace agreement. Simply because the US withdraws its troops from a conflict doesn't mean the war is over. President Barack Obama's administration discovered that when it pulled all its troops out of Iraq at the end of 2011, which helped to create a vacuum that ISIS then deftly exploited. Trump has rightly criticized the Obama administration for that withdrawal.

Read More