By Riva Gold, Ira Iosebashvili and Min Zeng

Donald Trump's surprise victory in the presidential race upended U.S. stock futures and markets around the world early Wednesday, concluding one of the most divisive and unpredictable campaigns on record.

Financial markets weren't prepared.

Futures pointed to a 1.9% opening loss for the S&P 500, more than twice the average post-election day decline of 0.9%. Futures had earlier tumbled as much as 5%, triggering a circuit breaker, as early results came in and signaled Mr. Trump would defeat Hillary Clinton to become the 45th president of the U.S.

But risk assets staged a remarkable recovery duringEuropean morning trading hours as the initial shock wore off and Mr. Trump vowed to begin the "urgent task of rebuilding our nation and renewing the American dream."

If the S&P 500 opens as expected, its losses will be far less dramatic than the 3.6% drop on the day after the U.K. referendum and its 9% drop during the height of the financial crisis.

Investors had largely counted on a narrow victory by Mrs. Clinton, who had been consistently leading in polls and betting markets right until roughly 9 p.m. Eastern time on Tuesday as polling results came in.

"The polls were wrong, but this time on the election of the president of the largest economy in the world," said Jordan Rochester, strategist at Nomura.

Brent crude oil shed over 3% as risk assets sold off, while gold climbed as much as 5% in a flight to safety before paring gains.

The yield on the 10-year Treasury note fell quickly from 1.896% to as low as 1.720% before recovering.

Global investors took note.

Japan's Nikkei Stock Average shed 5.4%, its biggest loss since Britain's June referendum, as the dollar fell to as low as Yen101.1940 against the yen.

European markets initially opened with a thud, as German's DAX shed 2.7% while markets in Spain and Italy shed over 3%. The export-heavy auto sector fared worse in the Stoxx Europe 600, shedding over 3% as the euro rose 0.9% against the dollar to $1.1115.

"When I felt the chances of Trump winning were increasing, I rushed into the office to warn clients," said James Butterfill, head of research and investment strategy at ETF Securities in London.

"We're worried of the geopolitical implications," he said, as well as what it means for the Federal Reserve and rising populist movements across Europe.

Losses in Europe began to moderate shortly after markets opened, with the Stoxx Europe 600 trading down just 0.6% midmorning. Gains in gold eased.

Investors were also beginning to question the Federal Reserve's plans to raise interest rates in December, betting that a period of market turmoil following the surprise election result could keep the central bank on hold.

The WSJ Dollar Index fell sharply but recovered to trade flat after European markets opened.

The Mexican peso, which had moved closely in line with Mr. Trump's polling success during the election campaign, fell as much as 11% against the dollar before recovering to trade down 7.3%.

The move in the peso was particularly noteworthy on the trading floor of Mizuho Financial Group Inc.'s Americas unit in midtown Manhattan Tuesday night.

"That is a very big move, especially over 3.5 hours," said Dan Riveira, managing director in foreign-exchange trading at Mizuho Financial. "The peso is being used as a barometer for the election."

As the currency's value rapidly flashed inmagenta on his screen, Mr. Riveira said this is the biggest move in the Mexican peso he can remember.

Chelsey Dulaney contributed to this article.

Write to Riva Gold at riva.gold@wsj.com, Ira Iosebashvili at ira.iosebashvili@wsj.com and Min Zeng at min.zeng@wsj.com

(END) Dow Jones Newswires

November 09, 2016 05:48 ET (10:48 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.