Updated 8:58 a.m. ET

Financial markets like certainty.

On Tuesday night, as the presidential election's outcome headed toward a Trump victory, stock futures plunged. Investors had bet heavily Monday on Democrat Hillary Clinton. But as Republican Donald Trump picked up many more votes than polls had predicted, markets reacted violently to the change in expectations.

Across the board, it turned ugly for equities, currencies and Treasurys. And it was happening around the world: Japan's Nikkei index closed down more than 5 percent. The Hang Seng Index was down more than 2 percent. European stocks fell too, though less dramatically.

In general, global investors were shifting money out of stocks and into safe havens. The Japanese yen shot up against the U.S. dollar while the Mexican peso fell. Gold prices rose. Yields on 10-year U.S. Treasurys initially fell sharply.

But after Trump's victory speech, the dollar regained some of its losses and other "fear" gauges seemed to quiet down as it became clear there would be no drawn out battle over electoral college votes.

As the sun rose on Wednesday in this country, stock investors seemed to adapt a bit to the election surprise and turned somewhat less negative. Initially, indicators suggested U.S. stocks could lose 5 percent of their value. But then, an hour before markets opened, futures trading suggested that the Dow Jones industrial average would start down about 1.2 percent to around 1,806.

The shock of this presidential race is hitting markets just months after voters in Britain stunned the world with their Brexit vote to leave the European Union.

Throughout the summer and into the fall, U.S. markets were relatively quiet as investors became confident that Clinton would win. Then in late October, when it appeared the FBI would reopen an investigation into questions about Clinton's email, stocks began a steady fall.

For nine straight days, the S&P 500 drifted down. But that sentiment turned around when the FBI said it had found nothing new that would trigger further action. On Monday, markets rebounded, with investors again becoming confident of a Clinton victory.

Investors generally saw her as a well-known figure whose economic policies would be similar to President Obama's. In contrast, Trump's positions are less clearly spelled out, and businesses generally oppose his key position — tearing up existing trade agreements.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.