HONG KONG — Markets went into free fall Wednesday and the Mexican peso tanked as Donald Trump appeared to be moving into the lead in the race for the White House.

Investors went running for cover, with the yen and gold rushing higher.

Japan’s Nikkei 225 index dropped 2.4 percent to 16,777.85 as the US dollar sank against the Japanese yen, a trend that would be unfavorable to exporters. Hong Kong’s Hang Seng plunged 1.7% to 22,514.70.

Initial confidence that market favorite Hillary Clinton would win the knife-edge race was wiped out as results showed the firebrand tycoon appeared to be heading for victory in the must-win state of Florida.

Clinton is considered by many investors to be a safer bet than Trump, who is seen as a loose cannon, with policies many fear could wreck the world’s top economy.

“Put your seat belts on because this is going to be a bumpy ride,” Chad Morganlander, a money manager at Stifel, Nicolaus & Co. in Florham Park, New Jersey told Bloomberg News.

“Investors will be moving in a chaotic fashion to get ahead of the information flow.”

Tokyo ended the morning session 2.2% down, having been up more than one percent at one point, while Hong fell 2.1% and Shanghai sank one percent.

Sydney gave up 1.7%, Seoul shed 1.7% and Singapore dived 1.4%. There were also losses of more than one percent for Taipei and Jakarta.

Futures on the Dow on Wall Street plunged 2.6%.

Tomoichiro Kubota, a senior analyst at Matsui Securities in Tokyo, said: “Overall, the market has priced in a Hillary victory by about 80 to 90%. If Trump wins, we can’t deny the possibility of wild moves.”

The Mexican peso — which was battered by Trump’s anti-immigrant rhetoric earlier in the campaign — tumbled towards record lows against the dollar.

The greenback at one point hit 19.8619 pesos up almost 10 percent from its earlier low and close to its record of 19.93 pesos.

The peso is considered a proxy of Trump’s chances because of his anti-Mexican rhetoric — including his pledge to remove undocumented immigrants, build a border wall and tear up a trade deal.

However the dollar tumbled against the yen as investors rushed into the Japanese unit, which is considered a safe bet in times of uncertainty and turmoil. The greenback was at 102.40 yen, down from above 105 Tuesday.

The euro also rose one percent against the dollar, while gold soared 1.6% to $1,305.

Oil prices plunged, with WTI sinking 3.3% and Brent 2.8% lower.