Appearing at a Washington think tank on Tuesday, US Ambassador to the UN Nikki Haley laid out what appeared to be a rationale for the Trump administration to walk away from the Iran nuclear deal next month.

The president faces an Oct. 15 deadline to recertify to Congress that Iran is continuing to comply with the agreement and that it remains in US national interests. If he does not do so, Congress can seek to re-impose the sanctions eased by the accord. Such an action – or a presidential decision not to continue to waive nuclear-related sanctions against Iran – would put the Trump administration in material breach of the agreement and raise serious doubts about its future.

Haley implied that Iran’s non-nuclear policies – primarily military intervention in Middle East conflicts on the side of US adversaries and continued development of ballistic missiles – undercut the utility of the Joint Comprehensive Plan of Action (JCPOA). But Iran was carrying out those policies before the JCPOA was reached and would likely continue or even intensify them in the absence of the nuclear agreement. To abrogate the deal now – at a time of continued instability in the Middle East and mounting tension with North Korea — would jeopardize, not boost, US national security. It would open grave new rifts between the United States and its allies and further weaken US leadership around the world.

The JCPOA, which went into full implementation in January 2016, does not eliminate Iran’s nuclear program but does impose serious restrictions that make it very difficult for Iran to develop nuclear weapons for at least a decade.

According to repeated reports by the International Atomic Energy Agency, the UN nuclear watchdog, Iran has abided by the restrictions, which included a drastic reduction in operating centrifuges, limits on the level of uranium enrichment, no enrichment at an underground facility and the dismantling of a heavy water reactor that could have yielded plutonium, another potential bomb fuel.

Contrary to Haley’s assertion that Iran received all the benefits of the agreement “up front,” it is the United States and the rest of the international community that obtained those benefits in the form of an extended “breakout time” for Iran to build nuclear weapons and irreversible destruction of the heavy water reactor. Iran did gain access to frozen oil revenues and has seen increased foreign investment and trade, but not at the levels it hoped to achieve.

A presidential decision not to certify Iranian compliance – and to kick the issue to a dysfunctional Congress as just occurred with the fate of undocumented immigrants who came to the US as children — would create new uncertainty about the JCPOA and act as a disincentive to foreign trade with and investment in Iran. It would weaken the government of newly re-elected Iranian President Hassan Rouhani, boost anti-Americanism among ordinary Iranians – who have tended to be pro-US in the past – and bolster hardliners within the complex Iranian political system.

It would also create a new crisis in transatlantic relations.

Haley acknowledged that, “our European allies want us to stay in the deal” but suggested that was not a major consideration for the Trump administration. “This is about US national security, this is not about European security,” she said.

The comment was striking given the long history of US-European security cooperation on matters ranging from terrorism to countering Russia. One wonders what European allies would have to say when the US seeks to renegotiate trade deals or to gain their support for other US priorities. How, to use Haley’s words, would disregarding the wishes of our closest allies about the Iran deal help “make Americans safe?”

If the US walks away from the JCPOA, it will likely walk away alone. The Europeans and key Iranian trading partners in Asia, such as China, India, South Korea and Japan, have indicated that they will continue to comply with the deal if Iran does so as well. Such a unilateral US move would also undercut the value of sanctions as a tool of foreign diplomacy – a tool that is needed more than ever to deal with other crises, especially North Korea’s escalating nuclear brinkmanship.

In her remarks, Haley painted a harsh picture of Iran, which was not entirely unfounded. Iran continues to hold US hostages – as it did shortly after the founding of the Islamic Republic – and it supports militant groups that have killed American military personnel in Lebanon and Iraq.

Haley omitted any mention of the harm successive US administrations have done to Iran, beginning with the 1953 coup against Prime Minister Mohammad Mossadegh, who had nationalized Iran’s oil resources.

In the 1980s, the US sided with Saddam Hussein during the Iran-Iraq war, going so far as to provide him with precursors for chemical weapons that killed and gravely injured thousands of Iranian soldiers and civilians. In 1988, at the war’s end, a US Navy ship, the Vincennes, accidentally shot down a civilian Iranian airliner, killing all 290 people on board. After many years, the US paid compensation to relatives of the victims but also awarded a medal to the captain of the Vincennes, earning lasting Iranian enmity.

Iran and the United States have clashed directly and indirectly many times since then, but the JCPOA represented a rare mutual victory achieved through intense direct diplomacy. It did not resolve all our differences but it averted further escalation and provided time and space to address those differences.

Arms control agreements by definition are not negotiated between friends but between adversaries such as the US and the old Soviet Union. They are meant to reduce the risk of war and to provide diplomatic channels that can avert misunderstandings.

Haley is right to say the JCPOA has flaws, but so do all international accords, which invariably require compromise. The best way to address perceived shortcomings in the JCPOA is through more diplomacy, not by throwing away a hard-won agreement that is working.

Barbara Slavin directs the Future of Iran Initiative at the Atlantic Council.