U.S. stocks closed at session highs Wednesday as Wall Street weighed a surprising victory by Republican Donald Trump in the presidential election after futures and overseas markets plunged last night.

The S&P 500 rose 1.1%, the Dow Jones Industrial Average gained 1.4%, rising by 256 points, and the Nasdaq rose 1.1%.

European stocks traded higher following losses earlier in the trading session.

"What we saw last night in terms of the futures and the currency movements was a sense of panic, in a certain way," Gregory Daco, head of U.S. macroeconomics at Oxford Economics, said. "But now, what we're seeing is this sense of uncertainty with rebounding stock prices, with currencies falling back in line to where they were, with the exception, perhaps, of the peso, which is notable."

Trump, who will serve as the 45th president of the United States, surprisingly won New Hampshire, North Carolina, Florida, and Wisconsin, key battleground states both candidates needed to secure to win the election.

Prior to the election, markets were factoring in a win by Democratic nominee Hillary Clinton, who said in her concession speech Wednesday that "we must accept this result and then look to the future. Donald Trump is going to be our president. We owe him an open mind and the chance to lead." President Obama spoke today, saying he and his team will work with Trump on a smooth transition of power.

The election saw Senate and House Republicans maintain their majorities in Congress.

"We think the stock market selloff will be short lived," Deutsche Bank analysts wrote in a note prior to the markets opening on Wednesday. "This apparent Republican sweep is positive for the broad market and especially health care stocks. The only sector that might suffer from this election outcome is energy, as we think a greater U.S. oil supply outlook weighs on the oil price recovery."

The energy sector was higher Wednesday after seeing losses earlier in the session. The Energy Select Sector SPDR ETF (XLE) was up 1.6%. But SunPower (SPWR) fell 14.2% as investors believe Trump's focus on coal and oil is seen as a negative for the global energy company.

Domestic crude oil supplies increased by 2.4 million barrels in the week ended Nov. 4, according to the U.S. Energy Information Administration. West Texas Intermediate crude oil settled 0.6% higher to $45.25 a barrel.

Healthcare stocks were rising Wednesday in reaction to Trump's victory. Biotech stocks, including Gilead Sciences (GILD) , Celgene (CELG) and Biogen (BIIB) were higher as was the iShares Nasdaq Biotechnology exchange-traded fund (IBB) that tracks these stocks. The ETF rose 8.9% in trading Wednesday. Drugmaker Pfizer (PFE) was up 7.1%.

A Hillary Clinton victory and a Democratic takeover of Congress would have been the worst-case scenario for biotech and drug stocks given her relentless criticism of rising drug costs and promises to curb them. Trump hasn't been as vocal or openly hostile to drug companies, but he hasn't embraced or even defended their pricing practices, either, wrote TheStreet's Adam Feuerstein.

Financial stocks saw a jump as Bank of America (BAC) shares rose 5.7%, Wells Fargo (WFC) gained 5.4%, and JPMorgan Chase (JPM) shares bounced higher by 4.6%. The SPDR Financial Sector exchange-traded fund (XLF) that tracks the financial-services sector was up 4.3% Wednesday.

"The re-pricing of everything has already begun," Stephen Guilfoyle, Stuart Frankel's chief market economist, wrote in a note. "Donald Trump has some isolationist ideas, but is not as anti-trade as presented in the media. His administration will likely be pro-business. His economics are pro-growth in the short-term. Reduced taxes, and increased fiscal spending provided by increased borrowing should produce a higher GDP."

Health care insurers were mixed as they prepared for a possible repeal of the Affordable Care Act under a Trump presidency. While Trump hasn't said what he will replace the health care law with, UnitedHealth (UHN)  up 0.4% Wednesday and competitors Anthem (ANTM) , Cigna (CI) , Humana (HUM) and Aetna (AET) saw gains. TheStreet's Alicia McElhaney has more analysis.

Investors will be assessing the Federal Reserve's next move to determine whether the U.S. central bank will raise interest rates at its December meeting as the U.S. economy has strengthened. An economist told the Associated Press that Trump's victory rules out a rate hike entirely.

"Given the adverse market reaction we have already seen, the Fed's planned December rate hike is now off the table," Paul Ashworth, chief U.S. economist at Capital Economics, told the AP. He said Fed Chair Janet Yellen and other top policymakers might even resign in the event of a Trump presidency, because his victory demonstrates that that many Americans share his view that the Fed has been "overtly political."

Safe-haven assets such as gold and government bonds moved higher on Wednesday as appetite for riskier assets fell.

Gold prices settled lower at $1,273.50 an ounce, down less than 0.1%. Gold had risen to above $1,300 an ounce after it became clear Trump would win the U.S. presidency. U.S. Treasury bond yields, which move in the opposite direction of their price, jumped to 2.074% for the first time since January.

Gold mining stocks jumped, including Newmont (NEM) up 2.7% and Goldcorp (GG) up 1.8% paring some of their earlier gains.

The Mexican peso fell at one point early Wednesday by more than 12% against the U.S. dollar. Throughout this election season, the peso has fallen when Trump's chances have risen as investors worried over the state of trade relations between the two countries under a Trump administration. Trump has promised to build a wall between the U.S. and Mexico.

United States Steel (X) gained 17.2% to $24.56 in afternoon trading as Jefferies analysts wrote that "the U.S. steel industry should stand out as a unique beneficiary of a Trump presidency." Analysts upgraded their rating of U.S. Steel to a buy, saying that "increased infrastructure spend may significantly boost demand for long steel product." They also highlighted that the U.S. "is already short steel, and falling imports will improve domestic pricing power."

Corrections Corporation of America (CXW) jumped 43.1% as investors anticipated the usage of prisons will increase with Trump's promise to deport illegal immigrants.

Viacom (VIAB) reported adjusted quarterly earnings of 69 cents a share, topping analysts' estimates by 3 cents. Revenue of $3.23 billion came in below forecasts.

Viacom investors will be looking for any commentary on a possible merger to reunite with CBS (CBS) . Viacom shares increased 1.7% Wednesday.

Wendy's (WEN) shares were up about 1.8% after the fast-food chain beat earnings estimates on revenue of $364 million.

Mylan (MYL) , the maker of the allergic reaction emergency treatment, EpiPen, reported a loss of 23 cents a share on sales of 3.1 billion matching analysts estimates. 

Shake Shack (SHAK)  share are up 10.2% in after-hours trading after reporting revenues of $74.6 million and profits of 10 cents a share. 

More from Markets

Asian Markets Decline in Morning Trading

Asian Markets Decline in Morning Trading

Verizon Proves Resilient in Sell-Off; Decoding the Facebook Short -- ICYMI

Verizon Proves Resilient in Sell-Off; Decoding the Facebook Short -- ICYMI

Three Big Factors That Rocked the Stock Market Tuesday

Three Big Factors That Rocked the Stock Market Tuesday

Dow Tumbles Over 400 Points; S&P 500 and Nasdaq Also Finish Lower

Dow Tumbles Over 400 Points; S&P 500 and Nasdaq Also Finish Lower

Caterpillar Bulldozes Industrial Sector With Bad News on Earnings Call

Caterpillar Bulldozes Industrial Sector With Bad News on Earnings Call