Donald Trump’s ill-thought and ill-timed decision to pull the United States out of the Iran nuclear deal was the act of a petty politician, not a president. Trump wanted to please his neoconservative counselors—yes, that was newly minted “national security adviser” John Bolton hovering in the doorway as the announcement was made Tuesday—by rejecting diplomacy in favor of a litany of discredited claims, dated “evidence,” and bombastic pronouncements.

Objections to Trump’s choice came swiftly from international allies, as the United Kingdom, France, and Germany expressed “regret and concern” over the American withdrawal from the Joint Comprehensive Plan of Action (JCPOA). Instead of following Trump’s lead, UK Prime Minister Theresa May, German Chancellor Angela Merkel, and French President Emmanuel Macron renewed their support for the nuclear-nonproliferation initiative, announcing that: “Together, we emphasize our continuing commitment to the JCPOA. This agreement remains important for our shared security.”

Organizations that understand what is at stake were aghast. “Political motivations, rather than real policy concerns, have driven Trump’s disdain for the accord,” read a statement from Peace Action. Congressman Ro Khanna, a California Democrat who serves on the House Armed Services Committee, said: “Withdrawing from the Iran Deal only sends the message that the US can’t keep its commitments when administrations change and the only way to resolve disputes with us is through nuclear deterrence. Pulling out makes it more likely, not less, that Iran will acquire a nuclear weapon.”

Referring to Bolton and Secretary of State Mike Pompeo, Khanna asked via Twitter: “Has Trump even read the #IranDeal? This terrible decision was clearly influenced by @AmbJohnBolton and @SecPompeo, two war hawks who are against diplomacy and peace in the Middle East.”

Khanna’s questioning was appropriate, as were his wise observations about the danger of reneging on the deal.

But the most vital criticism of Trump came from a president who refused to play politics with issues of life and death: Barack Obama.

Former presidents rarely criticize their successors. But Obama recognized that this is not just another of Trump’s Twitter outbursts. This is a substantive shift in US policy. And President Obama made it absolutely clear that he believes the shift is in the wrong direction.

Describing Trump’s move as “a serious mistake,” the former president argued that: “In a dangerous world, America must be able to rely in part on strong, principled diplomacy to secure our country. We have been safer in the years since we achieved the JCPOA, thanks in part to the work of our diplomats, many members of Congress, and our allies.”

The Obama administration helped negotiate the 2015 pact, which lifted sanctions on Iran in return for the acceptance by the Iranians of limitations on their nuclear program and oversight by international inspectors.

Noting that the Iranians are not in violation of the arrangement, and that European allies support maintaining it, President Obama wrote:

There are few issues more important to the security of the United States than the potential spread of nuclear weapons, or the potential for even more destructive war in the Middle East. That’s why the United States negotiated the Joint Comprehensive Plan of Action (JCPOA) in the first place.

The reality is clear. The JCPOA is working—that is a view shared by our European allies, independent experts, and the current US Secretary of Defense. The JCPOA is in America’s interest—it has significantly rolled back Iran’s nuclear program. And the JCPOA is a model for what diplomacy can accomplish—its inspections and verification regime is precisely what the United States should be working to put in place with North Korea. Indeed, at a time when we are all rooting for diplomacy with North Korea to succeed, walking away from the JCPOA risks losing a deal that accomplishes—with Iran—the very outcome that we are pursuing with the North Koreans.

Neither Trump nor his defenders are likely to be swayed by President Obama’s words. But the former president’s rare statement of disagreement with his successor offers a reminder that Trump’s misguided approach to international affairs is an exceptionally serious matter for the United States and the world.

“Walking away from the JCPOA turns our back on America’s closest allies, and an agreement that our country’s leading diplomats, scientists, and intelligence professionals negotiated,” warned Obama, who explained what every responsible president has understood across the more than two centuries of the American experiment: “In a democracy, there will always be changes in policies and priorities from one Administration to the next. But the consistent flouting of agreements that our country is a party to risks eroding America’s credibility, and puts us at odds with the world’s major powers.”