Consensus wisdom suggested that Donald Trump's stunning election victory would put markets on the defensive and send investors scrambling for safety.
But after some early signs of panic, stocks in the United States, Canada and Europe swung dramatically to wrap up a day of considerable gains.
While undoubtedly a shock in many senses, a Trump presidency does not necessarily represent a financial shock, said Stephen Rogers, a strategist at Investors Group Investment Management.
"There's an overwhelming sense that the world was changed when we woke up this morning. But only a fraction of that has to do with financial markets," Mr. Rogers said. "In the long run, markets are driven by long-term growth in the economy and profits."
It may take some time for investors to process the new political reality. And a sustained sell-off may yet take hold. But for several professional investors, it was surprising that the day after the unexpected result, the Dow Jones industrial average came within hair of hitting a record intra-day high. The S&P/TSX composite index, meanwhile, rose 0.7 per cent on the day.
Before election night, there was little doubt that the market in general was pulling for Democrat Hillary Clinton. A tightening of the polls in the final weeks of the campaign provoked the S&P 500 index's longest losing streak in more than 35 years. Nine consecutive days of losses ended only when the FBI announced two days before the vote that Ms. Clinton should not face criminal charges over the handling of classified information related to her private e-mail server.
Ultimately, the confidence among pollsters and investors that Ms. Clinton would prevail proved woefully misplaced.
When the will of U.S. voters emerged on Tuesday night and a previously unimaginable result dawned on the world, markets initially responded according to script.
As Mr. Trump picked up state after state overnight, turning the U.S. map into a sea of Republican red and ending Ms. Clinton's hopes for the White House, a flight to safety overwhelmed the markets. Gold, U.S. Treasuries, the Swiss Franc, the euro and the Japanese yen surged and risky investments were dumped.
At first, the market plunge was being compared in its severity with the fall after the Sept. 11, 2001, terrorist attacks in the United States; or with Brexit, Britain's vote on June 23 to leave the European Union.
As markets opened in North America, however, investors regained their composure and the safety trade seemed to reverse swiftly.
Gold's early gains of more than $63 (U.S.) an ounce, or nearly 5 per cent, were wiped out. And the Dow pulled off a swing of more than 1,100 points from its premarket low.
Analysts had a few different explanations for the unusual market resilience.
A Trump win is seen as making a rate hike by the U.S. Federal Reserve in December considerably less likely because of the possibility of market turmoil, potentially maintaining the full flow of stimulus from which many stock-market bulls draw confidence.
The composition of Tuesday's rally also suggests a rotation into sectors thought to be winners under a Trump administration.
Gains of 3 to 4 per cent in the health-care and financials sectors pushed indexes higher.
Pharmaceutical equities jumped on the expectation that Ms. Clinton's promised crackdown on drug prices will not happen. The Democratic candidate also had criticized operators of private prisons, the shares of which advanced with her defeat.
And defence and infrastructure-related stocks rose on Mr. Trump's spending promises.
"When you look at Trump's plans, they are actually pro-market," said Nadia Lovell, U.S. equity strategist at J.P. Morgan Private Bank. "Increased fiscal spending, that's great for infrastructure and defence names, less regulations … help banks, less involvement in health care – things that worried the market before."
Additionally, the market may be choosing to overlook some of the more extreme rhetoric of the Trump campaign, said Jerome Hass, a partner at Toronto-based hedge fund Lightwater Partners.
"Power has a way of moderating political views. A lot of the things people fear about Trump, I don't think they'll come to fruition."
With reports from Reuters, Eric Reguly, Andrew Willis and Jacqueline Nelson