Judging from the media reaction to Donald Trump’s announcement that the United States is backing out of the agreement to halt Iran’s nuclear weapons program, “the story” begins in 2013, when President Barack Obama entrusted Secretary of State John Kerry to help negotiate a deal with Iran and our European allies. Or in 2015, when an international accord was announced after two years of arduous bargaining. Or, perhaps with candidate Trump’s campaign pledge to dismantle the “terrible deal.”

But in fact, the nuclear saga between Iran and the United States goes back about 60 years. And in order to understand the significance of the agreement Trump just shredded under the delusion that a “better deal” is forthcoming, it is worth revisiting that history.

The United States started Iran’s nuclear program in 1957, as part of Eisenhower’s ill-fated “Atoms for Peace” initiative. Iran’s U.S.-sponsored dictator Mohammad Reza Shah Pahlavi recognized by the 1970s that the development of nuclear power could also help Iran develop nuclear weapons. Even more ironic from today’s perspective, Israel played a key role in discussing plans with the Shah’s regime for the Iranians to weaponize their program.

Yet, when the Shah was overthrown in the 1979 Revolution, Ayatollah Khomeini ordered the termination of the nuclear program, calling it “un-Islamic.” In 1984, however, he reversed course at least in the realm of nuclear power and sought international cooperation to further develop that program. In 2005, Ayatollah Ali Khamenei, the Supreme Leader of Iran since 1989, not only affirmed Iran’s commitment to nuclear non-proliferation, he issued a binding religious edict (fatwa) forbidding the development or use of weapons of mass destruction.

By that time, though, the United States (along with Israel), was locked in a policy of enmity and suspicion. In 1995, Israeli Likud Party chairman Benjamin Netanyahu had declared that Iran was a mere “three to five years away” from obtaining a nuclear bomb. After extensive lobbying from the American Israel Public Affairs Committee (AIPAC), Bill Clinton designated Iran’s nuclear program as a national security priority of the United States. One year later, the 1996 “Iran and Libya Sanctions Act” was passed—declaring that any party from the European Union, Australia, Israel, Japan, or Korea that did business with Iran would face U.S. economic sanctions.

For pretty much everyone, this was an easy choice. Iran found itself suddenly isolated from the major world economies. Perhaps unsurprisingly, the remainder of Clinton’s term was marked by tension and hostility between the two countries. In 1997, Iran elected reformist Mohammad Khatami to power—but despite talk from both sides about the possibilities for better relations, fundamental disagreements remained unresolved.

When George W. Bush took office, Iran hoped for a fresh start. Then 9/11 happened. In the aftermath, Bush branded Iran as part of the “Axis of Evil” and invaded neighboring Afghanistan. The United States then toppled Saddam Hussein in Iraq on allegations they had a secret WMD program. The intelligence was bogus, but the chaos and destruction were extensive.

The United States used to encourage the development of nuclear technologies in Iran—but that was when the Shah was in power.

Iran reached out to the United States in 2003 hoping to resolve concerns about its nuclear program by opening up negotiations. The Bush administration refused. Two years later when Iran tried to negotiate a deal with the European Union, Khatami’s deputies, Hassan Rouhani and Javad Zarif, offered an aggressive deal—one that would have limited Iran’s capacity to three thousand centrifuges (for perspective, the current deal allows them five thousand). Bush effectively killed the negotiations, saying any nuclear capacity for Iran was too much—and insinuated that regime change was the only truly acceptable outcome for America.

Having failed on his election pledges to bolster Iran’s economy and normalize relations with the rest of the world, Khatami was thrown out of office in 2005—replaced by populist hardliner Mahmoud Ahmadinejad.

Under his tenure, Iran dramatically increased its nuclear capacity and production and took a more confrontational posture toward the United States and Israel. In response, the United States drew up plans to forcibly overthrow the Islamic Republic—intending to use their new forward operating bases in Afghanistan and Iraq to project power against Iran on multiple fronts.

Fortunately, this plan was ultimately thwarted by the insurgency in Iraq, which bogged down U.S. troops and soured the public on the prospect of another regime-change in the Middle East.

In 2008, Bush was out, Barack was in. Obama campaigned on a foreign policy platform of diplomacy and engagement—and right out of the gate, he tried to walk the walk. The White House reached out to Tehran, hoping to restart discussions to resolve the nuclear issue. Ahmadinejad would have none of it, arguing that the United States could not be trusted. Obama responded by increasing sanctions on Iranian oil.

In 2013, fate finally provided the world with leaders in both countries who were willing to talk. The broker of the attempted 2005 deal, Hassan Rouhani, was elected president of Iran. He vowed to start a new chapter in relations with the United States, despite the deep-seated mistrust between the countries.

After two years of negotiations, the Joint Comprehensive Plan of Action (JCPOA) was signed by the United States, China, Russia, France, Germany, the UK, EU, and Iran—and was unanimously endorsed by the UN Security Council. According to President Obama, it marked “the most far-reaching inspections and verification regime ever negotiated in an arms control deal.”

Three years in, the deal has worked as intended: According to the International Atomic Energy Agency, Iran has been fully compliant. U.S. military officers and Israeli security officials assert that both countries have been made secure by the deal. The American public approved of the deal by a 56 percent to 26 percent margin, according to a Morning Consult-Politico poll last month.

It’s worth noting that some sanctions against Iran were left in place by the JCPOA, and the economy has continued to struggle. Yet Iran’s oil exports more than doubled and its GDP increased by 4 percent in 2017. Iranian President Hassan Rouhani was able to leverage the JCPOA’s success into winning reelection by a wide margin, and earning a mandate to make more substantial reforms to the state.

The EU, China, and India have also seen financial windfalls from trading with Iran. The deal served as clear proof that even gnarly and pressing disputes can be peacefully mitigated through good-faith multilateral negotiations—legitimizing not just organizations like the UN, but in many respects, the EU itself.

You might therefore think that everybody has gained from the deal: the U.S., Israel, the E.U., China, and Iran. Of course, for Trump this is a problem: in his Pareto suboptimal universe, unless Iran is clearly “losing,” America is definitely not “winning” like it should.

On Tuesday Trump finally announced his intention to abandon the deal. European leaders said they’d stay the course if Iran was willing. Iran replied they’d stay in the deal without the United States, so long as sanctions were not re-imposed by other signatories. Of course, Trump is all for re-imposing sanctions—again declaring that anyone who does business with Iran will face U.S. economic penalties.

In the mind of Trump, America is not winning unless Iran is clearly losing.

It’s looking like India and China may continue to buy Iranian oil despite this threat. The UK, Germany, and France have vowed to stay in the deal so long as Iran remains compliant, and are trying to come up with workarounds for trade. Rouhani is in talks to see if an acceptable solution can be found despite the U.S. withdrawal and sanctions. We should all pray for their success.

Under pressure from hardliners in his country who believed it was naïve to negotiate with America to begin with, Rouhani has declared that if the deal falls through—if the EU cannot come up with a workable solution to this crisis—then Iran will ramp up industrial uranium production to higher levels than before the 2015 agreement. Inspectors will likely be granted far less access (if any) to Iran’s sites. American hawks will assert that the Islamic Republic is trying to “sprint” toward a bomb—and then actual bombing would likely commence.

The costs for America of a new war would be very high. It would be ruinous for the Middle East. International organizations like the U.N. would be further delegitimized. Energy prices might skyrocket, due to the new disruptions in the oil supply. That could lead to wild stock market volatility or even trigger a recession.

They’re currently burning American flags in the Iranian parliament and chanting “Death to America”—but Trump’s true believers are assured a terrific new agreement is right around the corner. After all, President Trump did “write” the Art of the Deal.