Former CIA Director John Brennan accused President Donald Trump of lying about the Iran nuclear deal he withdrew the U.S. from on Tuesday, and said, "This madness is a danger to our national security."

Brennan served under former President Barack Obama, who forged the deal in 2015. He tweeted on Tuesday that "Donald Trump simultaneously lied about the Iranian nuclear deal, undermined global confidence in U.S. commitments, alienated our closest allies, strengthened Iranian hawks, & gave North Korea more reason to keep its nukes."

"This madness is a danger to our national security," added Brennan, who was CIA director from 2013 until Trump's inauguration.

Today, Donald Trump simultaneously lied about the Iranian nuclear deal, undermined global confidence in US commitments, alienated our closest allies, strengthened Iranian hawks, & gave North Korea more reason to keep its nukes. This madness is a danger to our national security.

In his speech Tuesday announcing that the U.S. would no longer honor the deal, Trump said there was "definite proof" of the Iranian regime's pursuit of nuclear weapons.

"The fact is, this was a horrible, one-sided deal that should have never, ever been made," Trump said. "It didn't bring calm, it didn't bring peace, and it never will."

Brennan, now an analyst for NBC News and MSNBC, said in an interview with the latter that Trump has a "very flawed understanding" of the deal, which six countries signed requiring Tehran to limit its nuclear weapons development program in exchange for the lifting some sanctions.

Former Director of the U.S. Central Intelligence Agency (CIA) John Brennan testifies before the House Permanent Select Committee on Intelligence on Capitol Hill, May 23, 2017 in Washington, D.C. Alex Wong/Getty Images

The former CIA director referenced Obama's statement on the withdrawal that "laid out clearly the facts of the deal" and "what type of assurances we have that Iran is not going to pursue this."

"With the wave of the hand, Mr. Trump has sent a very bad signal to Iran, to North Korea, to our allies, as well as to Russia and China, in terms of, can they count on something that Washington agrees to when administrations change," Brennan said.

He continued: "He has hurt, I think, the prospects for peace and for successful diplomacy. By basically discarding something that was hard-fought and well supported by our allies as well as members of the security council of the United Nations."