The shocking vote by citizens of Great Britain to leave the European Union had an immediate impact on the U.S. presidential race, with Donald Trump hailing the result as a triumph of nationalism and Hillary Clinton warning of the risks it posed to global economic security.

In Scotland to visit one of his golf courses, Trump, the presumptive Republican nominee, used the vote as vindication for his own platform of robust nationalism and an immigration crackdown.

"Basically, they took back their country, that's a great thing," Trump said. "They're angry over borders. They're angry over people coming into the country and taking over, and nobody even knows who they are."

Clinton, the presumptive Democratic nominee, used the surprise outcome to argue for a steady hand in the White House. "This time of uncertainty only underscores the need for calm, steady, experienced leadership in the White House to protect Americans' pocketbooks and livelihoods, to support our friends and allies, to stand up to our adversaries, and to defend our interests," she said in a statement. "It also underscores the need for us to pull together to solve our challenges as a country, not tear each other down."

But the U.K. vote is clearly a win for Trump and a warning to Clinton about the level of global economic anger, resentment of elite globalists and fear over the impact of immigration, especially from the war-ravaged Middle East.

Polls and betting markets in the U.K. leading up to the Brexit vote suggested that the Remain side would win fairly comfortably. A large YouGov survey of Brexit voters conducted after they went to the polls had Remain winning 52 percent-48 percent. The result seemed so certain that chief Leave advocate Nigel Farage, head of the U.K. Independence Party, appeared to essentially concede defeat early in the night.

But then the votes started to pile up and Leave opened up an early lead that it would never relinquish en route to a comfortable 52 percent-48 percent win and a margin of more than 1 million votes. By Friday morning, British Prime Minister David Cameron had resigned and far right leaders across Europe were calling for similar referenda on ditching the EU.

The lesson for U.S. politics is that polls showing a steady lead for Clinton could underestimate the extent to which voters are fed up with the status quo and are willing to take a risk on a candidate like Trump — whose rhetoric on trade and immigration is very similar to that used by the Leave campaign.

Economic damage from the Leave vote could also hinder Clinton's hopes of holding the White House for Democrats, which under any circumstance is difficult for the incumbent party after eight years in power. The U.S. only grew 0.8 percent in the first quarter, job gains are slowing and the Federal Reserve is essentially out of ammunition to fight a fresh downturn.

But even the lack of a major economic impact — either in Europe or in the United States — could also be good for Trump as it could show voters that voting in favor of nationalism and tighter borders may not be the economic disaster that many political elites suggest.

The vote in the U.K. also demonstrates for Democrats the tough sell they have to voters with a candidate at the top of the ticket who is deeply tied to the establishment and has spent much of her career raising money from Wall Street and talking up the benefits of globalism and free trade.

Clinton backed off her previous support for the Trans-Pacific Partnership during the Democratic primaries. But she still has a tough sell convincing supporters of Vermont Sen. Bernie Sanders that she truly understands their anger over free trade and stagnant wages and has a plan to address these problems that is easy to understand.

The Brexit vote could also boost the chances for Massachusetts Sen. Elizabeth Warren to emerge as Clinton's vice presidential nominee. If the Clinton campaign decides they need a bold stroke to show that the candidate is in tune with the tide of populism sweeping the U.S. and the globe, Warren would be the natural choice.

The odds still favor Virginia Sen. Tim Kaine as Clinton's VP pick. But going the safe, nondescript route could itself be a significant risk as the world seems to be on fire for major change.