The United Kingdom will no longer be a part of the European Union and, to hear the prime minister tell it, that may play right into the hands of the Islamic State group.

“Who would be happy if we left?” Prime Minister David Cameron said last month ahead of the so-called Brexit vote last month, before predicting that ISIS leader Abu Bakr al-Baghdadi would favor a vote to leave. “Putin might be happy. I suspect al-Baghdadi might be happy.”

Now, as a wave of uncertainty washes over international markets after 52 percent of U.K. voters voted Thursday to ditch the EU, it appears Cameron had a crystal ball. ISIS supporters quickly praised the exit Friday and called for attacks on Berlin and Brussels — both high-profile European capitals — in order to destabilize what is left of the Union.  The decision to leave could also have an important impact on the relationship between the United States and the United Kingdom, as well as defense capabilities of Europe as they continue to fight the terror group.

The U.K. is one of the most ardent supporters in the EU of American foreign policy, and its leaving could mean European countries will be less inclined to match up with U.S. operations and goals. That means, according to an Atlantic Council report looking into the referendum, coordinated operations in Syria may become less effective.

Meanwhile, the straight numbers impact on defense is striking: Britain accounts for just 14 percent of EU gross domestic product and yet provides 20 percent of the Union’s defense budget. The U.K. is joined by France as the only two nuclear countries in the EU, which means that soon just one country in network will have a full military arsenal at their disposal. In light of all of this, defense was a major argument in favor of staying.

“Keeping our people safe from modern terrorist networks like Daesh [an Arabic name for ISIS] and from serious crime that increasingly crosses borders, means that we simply have to develop much closer means of security cooperation between countries within Europe,” Cameron said recently.

As for ISIS supporters, the immediate goal is — according to a message on an encrypted messaging service popular with ISIL militants — to paralyze the West.

“At a time when Muslims are uniting under the flag of the Caliphate, Europe is choosing to divide and split. The victory is close with the help of God,” one ISIS supporter tweeted. “The rise of the Islamic State brought about the sinking of Britain and the collapse of the European Union.”

And yet protecting the U.K. from ISIS was also a key argument for advocates of leaving the EU in the first place. Among the many concerns weighing on the minds of voters was the uncertainty and fear that the terror group has produced, increasing with each refugee who has stepped foot on European shores.

Before the European Union was created in 1993, the U.K. didn’t really have much of an immigration experience or problem. But, between that time and 2014, the number of foreign-born people in the country more than doubled from 3.8 million to 8.3 million, according to Oxford researchers.  And, following the 2008 financial crisis, the number exploded, with people from poorer EU countries like Spain, Italy and Portugal flocking to greener pastures on the large island to the north.

With Syrian refugees coming to the continent in record numbers, fleeing the violent civil war, pro-Brexit campaigners ramped up the immigration control rhetoric. And voters responded to that argument: A May poll found that 52 percent of British voters thought that a Brexit would improve the U.K. immigration system.