President Donald Trump’s decision to pull the US out of the Iran nuclear deal will benefit some countries while hurting many others — and the winners and losers aren’t the ones you’d expect.

Trump spent years railing against the Iran deal and threatening to pull the US out of it. He’s finally done so, a move that will reshape global politics, deal a serious blow to the American-led effort to contain the spread of nuclear weapons, and undo a major part of Barack Obama’s foreign policy legacy.

It’s a massive victory for Israel and Saudi Arabia, which have been pushing for the US to confront Iran more aggressively. It’s also a major win for hardliners inside Iran who have long argued that the United States could never be trusted — and long called for harsher anti-US policies.

And that’s only a partial list. What follows is a look at how seven different people and governments are affected by Trump’s announcement — a concrete way of looking at how this massive decision changes the world, for the better and (mostly) for the worse.

Loser: Donald Trump

Trump got what he had always wanted. And it may well prove to be a textbook reason why people — especially US presidents — should be careful what they wish for.

On the campaign trail, Trump hammered the Iran nuclear agreement as a disaster, a catastrophe, and “the worst deal ever.” When he won the presidency, he was finally in a position to cancel it — but was repeatedly talked out of it by moderate advisers like then-Secretary of State Rex Tillerson and then-National Security Adviser H.R. McMaster.

Trump fired both men earlier this spring, and their replacements — Mike Pompeo and John Bolton, respectively — are Iran hawks. After a year of having advisers tell him to stay in the deal, Trump finally has ones telling him to pull out.

But what you want isn’t always what’s good for you. There is no evidence that Trump has a plan B, a notion for how to deal with Iran’s nuclear program now other than simply slapping sanctions on Iran and hoping for the best. What is the point of the sanctions? Is there anything Iran could do to get them lifted — some kind of “better deal” they could agree to — or is the idea just to punish their economy, and ordinary citizens, forever?

I don’t know the answer to those questions, and no informed observer seems to think Trump does either.

In addition to the lack of strategy behind imposing new sanctions, there’s always the chance that Iran restarts its nuclear program in earnest. After Trump’s speech, Iranian President Hassan Rouhani announced that he was preparing to resume “industrial” uranium enrichment if the Europeans couldn’t convince Iran that staying in the deal was worth it — the kind of prohibited nuclear activity the deal was designed to stop.

That means Trump might soon find himself in a situation where Iran is racing toward a bomb, forcing him to either let them go nuclear or start a war to stop it — the truly awful choice the Iran nuclear deal was supposed to head off in the first place. There’s no evidence the president has thought through this situation, or what he would do in the event that Iran follows his lead and exits the agreement.

Before this announcement, Trump didn’t really have to deal with the Iranian nuclear standoff: He could criticize the deal without needing concrete plans for what to put in place in its stead. Now, though, he’s forced to try to come up with a solution to an extremely difficult problem for which all the available options seem ineffective or disastrous. He’s put himself in a tough situation, and he’ll own whatever comes next.

Winner: the Israeli-Saudi Arabian alliance

It’s no secret that Israeli Prime Minister Benjamin Netanyahu wanted the United States to exit the Iran nuclear deal. He gave a televised presentation of Israeli intelligence last week that was a naked attempt to convince Trump to quit the deal.

Netanyahu wasn’t the only Middle East power to hope for the deal’s demise. Saudi Arabia’s young crown prince, Mohammed bin Salman, has long opposed the agreement and mounted a quiet lobbying campaign to kill it. He has befriended Trump son-in-law Jared Kushner and no doubt talked his ear off about the deal’s defects.

These two men lead very different countries, but they had basically converged on a similar worldview: Iran’s regional influence is the greatest threat to their country’s security and needs to be confronted directly. They felt the Iran deal was dangerous both because of perceived flaws in the agreement itself and because it brought the United States and Iran closer together.

The deal, in their view, made the United States too accommodating of Iran, too unwilling to challenge its broader regional wrongdoing in places like Syria and Yemen — and thus, it had to go.

“For them, this comes down to: The only way to keep the United States engaged in the region, and provide a security blanket for Saudis and Israelis ... is to make sure Iran is not normalized through this set of international and regional agreements,” Hussein Banai, an expert on US-Iran relations at Indiana University Bloomington, tells me.

That risk is now gone, at least for the time being. With Trump reimposing sanctions on Iran and unilaterally exiting the agreement, the US and Iran may be on a collision course. This may play out politically, economically, or militarily — but however it ends up, it’s hard to imagine the US growing closer to Iran as long as Trump is in office. The lobbying campaign, in other words, paid off.

Loser: people who want there to be fewer nuclear weapons

One of the top priorities of US foreign policy since the end of World War II has been to stop the spread of nuclear weapons. The theory is that these weapons are so uniquely destructive, so dangerous, that they cannot be treated as ordinary weapons and must be possessed by as few countries as possible.

This longstanding effort has had its failures — North Korea springs to mind — but has mostly worked pretty well: Only a handful of countries have nuclear weapons, and several are stable and responsible nations like France and Britain. This isn’t because they’re hard to make technically — again, North Korea managed to build them — but because the US and its allies have set up a system of international rules and agreements that make it difficult for countries to build nuclear weapons without incurring major international backlash.

From that narrow point of view of stopping the spread of nuclear weapons, the Iran deal was a massive success. The pressure created by international sanctions was so intense that Iran agreed to a series of extremely stringent restrictions on its (fairly advanced) nuclear program. Among other things, the deal called for:

Reducing Iran’s stockpile of enriched uranium by 97 percent, and banning the country from possessing any uranium potent enough that it could be used to fuel a bomb

Capping its number of nuclear centrifuges, devices used to enrich uranium, at roughly 5,000 — and only permitting it to use old, outdated, and slow centrifuges

Stopping Iran from operating its Arak facility used to make plutonium that could fuel a bomb

Permitting wide-ranging and intrusive International Atomic Energy Agency (IAEA) inspections designed to verify that Iran isn’t cheating on any portion of the deal

These provisions, taken together, make it functionally impossible for Iran to acquire a nuclear weapon so long as they are in place — and they were scheduled to last for at least a decade. The IAEA has repeatedly confirmed that Iran is complying with all of its obligations under the deal.

“With the deal in place, it would be extremely difficult for Iran to build the bomb without being detected — and there would be a time frame that would allow the international community to respond,” James Acton, director of the Carnegie Endowment’s Nuclear Policy Program, tells me.

But now the deal is in jeopardy. The international community is divided, and worse, its credibility is in question: If you were a rogue state — again, let’s just use North Korea as an example — would you really give up your nuclear weapons to this administration? Would you trust the United States to keep its promises when Washington seems to change major policies with every election?

No, you wouldn’t. This decision makes it more likely that Iran will get a nuclear weapon, and makes it somewhat more likely that other countries will at least try to do the same.

Loser: Barack Obama

I mean, this one’s obvious right? The nuclear agreement with Iran was one of the last president’s signature accomplishments, perhaps the most important part of his foreign policy legacy. And Trump may have just dealt it a mortal blow.

More broadly though, Trump seems to have a deliberate agenda of tearing down Obama’s legacy — even when he has little to gain from doing so.

He pulled the US out of the Paris climate accord, which imposed no actual obligations on the United States, and announced the decision in a giant Rose Garden ceremony with a live band. Trump has tried to sabotage Obamacare, doing things like halting payments to insurance companies that keep premiums down, which accomplishes little in the way of actually improving the US health care market.

It seems like destroying Obama’s legacy isn’t just a fun little side project of Trump’s but actually an animating goal of his entire policy agenda, domestic and foreign. If you’re wondering why Trump would do something as plainly self-defeating as unilaterally withdrawing from the Iran deal, this is a good place to start.

Winner: Iran’s hardliners

Americans often like to pretend that Iran doesn’t have a political system and is instead an undifferentiated mass of anti-American religious zealots bent on building a bomb to challenge America.

This was never accurate, and the nuclear deal proved it. The deal was the pet project of a (relatively!) moderate faction of the Iranian political elite, led by President Rouhani and Foreign Minister Javad Zarif. The Rouhani-Zarif faction argued that giving up Iran’s nuclear program would lead to increased economic ties with the rest of the world, and thus prove that cooperation with the world, and integration into the international community, was a better foreign policy than confrontation.

So long as the deal was in place, they had a point. But Trump’s decision to withdraw from the agreement has given their more hardline opponents, including the leaders of Iran’s elite Revolutionary Guard, the upper hand in the domestic political argument.

“The nuclear deal has been Hassan Rouhani’s singular achievement as president. He’s already a weak president,” Karim Sadjadpour, a senior fellow at the Carnegie Endowment for International Peace, tells me. “Introducing greater insecurity plays to the interests of Iran’s security forces.”

Ayatollah Ali Khamenei, the man who makes the final decisions in Iran’s political system, always seemed inclined to favor the hardliners over the Rouhani faction. Now Trump has given him reason to continue down that path — meaning more confrontation with Iran’s regional rivals in the Middle East and with the United States is practically certain.

Loser: James Mattis

In the early months of the Trump administration, the president was surrounded by something reporters called “the axis of adults”: McMaster, Tillerson, and Secretary of Defense James Mattis. All of these people were seen as relatively sober advisers who would restrain Trump’s reckless impulses. More specifically, all of them wanted Trump to remain in the Iran deal.

McMaster and Tillerson are gone, replaced, respectively, by Bolton and Pompeo — both men who had publicly and repeatedly called for scrapping the Iran deal. Mattis, seen as the most influential of the adults, was facing a test: Could he outmaneuver the new Cabinet members and President Trump’s inclinations at the same time?

The answer, it seems, is no. There are limits to Mattis’s influence; he can’t contain Trump all the time, and on this one, he lost.

This isn’t a pointless power struggle. The more influence Mattis has, the more likely Trump is to be restrained and cautious in his decision-making. The fact that Mattis couldn’t keep him in the deal suggests that we’re edging toward something more like Trump Unchained, where the president just does what he feels like. Given how wildly Trump’s policy preferences vary, that’s potentially a very dangerous situation for the world.

Loser: Europe

Since the relaxation of international Iran sanctions, European companies have scrambled to get into the Iranian market. The German car company Daimler hoped to sell roughly 40,000 cars a year to Iranians; Saipem, an Italian oil and gas company, signed an agreement that could be worth as much as $5 billion.

Trump’s announcement puts all of that in jeopardy. He explicitly announced today that he would impose a major portion of the pre-deal sanctions regime — something called “secondary sanctions” targeting Iran’s oil sector. Secondary sanctions don’t punish Iran directly, instead targeting international banks and companies that do business with Iran’s oil sector.

Hence why they’re “secondary”: Instead of hitting the primary target, Iran, they cut off access to US markets for third parties that want to work with Iran. In theory, they force foreign countries into a choice between doing business with Iran and the United States. Since America is the world’s largest economy, it’s not exactly a hard choice. Depending on how strictly the Trump administration ends up implementing these sanctions, it could do serious damage to the budding economic relationships between European countries and Iran.

And that underscores the broader stakes here. This isn’t just an American-Iranian agreement; there are five other parties that are part of the Iran deal (Germany, France, the UK, Russia, and China) and many other countries indirectly affected by secondary sanctions. Trump has pissed off all these countries, including many close allies, for relatively limited gain — a situation that would only get worse if he does in fact sanction large European countries doing business in Iran.

This decision announcement didn’t just kick off a crisis with Iran. It started a wider international crisis with unclear ramifications for the world.