Britons might never have voted to leave the European Union had it not been for the refugee crisis that hit Europe as a result of the Syrian civil war. Even though Britain has accepted only some 5,000 Syrian refugees, German premier Angela Merkel agreed to take in 800,000, thus fueling fears across the continent of an influx of possible terrorists. Those fears were exploited by elements of the “Leave” campaign, principally Nigel Farage and the UK Independence Party, and no doubt contributed crucial momentum to the final outcome.

Who could have possibly imagined that one of the consequences of President Obama’s failure to intervene in Syria to stop the civil war would be Britain’s exit from the EU—a move that he opposed? This is just another reminder that international relations are a complex system with an endless number of moving parts, making the ripple effects of important decisions impossible to predict.

That realization should also make us guarded in assessing the security implications of Brexit. At first blush, they do not look good. Britain has been the most stalwart pro-Atlanticist voice in the EU. Its politicians have made a case for tougher sanctions against Russia than many of the Continental states, which are more dependent on Russian natural gas and oil.

Britain will, of course, stay in NATO, but its voice in the EU will be silenced, making it likelier that the EU will suspend or soft-peddle sanctions imposed as punishment for the Russian invasion of Ukraine. That is why Vladimir Putin has been working overtly and covertly to break up the EU. Among other things, the Russian strongman has been giving aid and encouragement to anti-EU parties such as UKIP and, in France, the National Front. His ultimate objective is to break up the EU entirely—something that becomes more likely now that Brexit has passed. The EU is deeply unpopular in many of its member states. The most notable exceptions are the Eastern European states, which see the EU as a vital buffer against Putin’s aggression. If the UK succeeds in exiting, others may decide to follow suit.

All that said, Brexit does not have to be as much of a drag on collective security as many commentators (including me) fear it might be. The key variable is what sort of Britain emerges from the rubble: Will it be a Great Britain or a Little England?

Part of the answer will depend on whether Scotland decides to stay or to go, the chances of secession having grown because the Scots are as pro-EU as most of the English are anti-EU. If Scotland goes, Britain would lose nearly 8 percent of its population and GDP along with its only nuclear submarine base. That would make it harder, if not necessarily impossible, for Britain to play the kind of outsize role in world affairs it has played for centuries. But of course, the future of Scotland is not a decision for Scotland alone. Much will depend on the future of British politics.

Some of the most ardent “Leave” campaigners are Russian apologists and immigration bashers; they are, in short, the British version of Donald Trump. If they get their way, Britain will pull up the drawbridge and pursue an essentially isolationist course. But that is not true of the mainstream Tories who backed Brexit. Conservatives such as Justice Minister Michael Gove and former Defense Minister Liam Fox are confirmed Atlanticists who want the UK to punch above its weight and to act in close concert with the United States. Boris Johnson, the front-runner to replace David Cameron as prime minister, is a mercurial figure who waited until the last minute to announce whether he was pro-or anti-Brexit and was widely suspected of joining the “Leave” side to further his own political ambitions. But with his outspoken admiration of Winston Churchill, he would seem to be on the side of those who want an active and strong and pro-American British foreign policy.

The Labor Party is even more split on these issues than the right. Its current leader is Jeremy Corbyn, a far-left “nutter” who has been an outspoken advocate of Irish and Palestinian terrorism, a foe of Israel and the United States, and a sympathizer for every Communist dictatorship on the planet. Corbyn was a lukewarm and reluctant supporter of the “Remain” side because he views the European Union as a “neo-liberal” plot to impose a free market on Britain (in contrast to Conservative “Leave” campaigners who view the EU, with more justification, as a statist plot to impose illiberal policies on Britain). He now faces a revolt among Labor MPs who would like to see a leader more in the mold of Tony Blair or Gordon Brown, the last two Labor prime ministers who were both pro-American and in favor of an activist foreign policy.

A key indicator of which way post-Brexit Britain will go–toward a more activist or a more isolationist foreign policy—will come in the defense budget of Cameron’s successor as prime minister. The current Tory government cut defense spending by 20 percent, leaving Britain’s armed forces at their smallest levels in centuries. Last fall, facing growing dangers from Russia, ISIS and other quarters, Cameron finally reversed course and announced a modest increase in the defense budget that will allow Britain to maintain defense spending of 2 percent of GDP—the NATO benchmark, which few other European states meet. If Cameron’s successor builds on that defense budget and puts even more pounds into the Ministry of Defense, there is a real chance for Britain to emerge stronger from the EU than it has been in it. London could pursue a more Atlanticist course without as much need to cater to the anti-American prejudices of some of its Continental neighbors. It could even provide more military capacity that NATO desperately needs to continue to deter the growing Russian threat in the East. And that would be great news for the United States, which has counted on its “special relationship” with Britain since World War II.

It is too soon to say which way the situation will develop, given how many wild cards are still in play. Assuming that Trump-style isolationism does not take hold on the other side of the pond, the U.S. can play a useful role in urging Britain to continue working with Washington to provide much-needed security for the international community as it has done for decades. A good sign that the “special relationship” still exists would be to move expeditiously to negotiate a U.S.-U.K. free trade treaty.