US stocks have surged to close higher as the presidential election race remains cloudy but the likelihood of gridlock in Congress has made investors optimistic major policy changes will be difficult to enact.

Both President Donald Trump and Democratic nominee Joe Biden still had paths to reach the 270 Electoral College votes needed to win as states kept counting mail-in ballots.

Biden held a narrow lead in Wisconsin late on Wednesday while Trump’s campaign said it had filed a lawsuit there in an attempt to halt vote counting.

A surprise win by Republican Senator Susan Collins in Maine dimmed Democrat hopes they could get control of the US Senate.

Growth stocks, currently comprised of a large portion of names in areas such as tech, surged as investors anticipated a similar landscape to the one in the months leading up to the election, in which they generally outperformed value stocks, which are currently comprised of mostly cyclical stocks like banks and energy.

“Even if Joe Biden wins the presidency, it looks like we are going to have a divided congress so the opportunity to have meaningful change at the fiscal level is pretty slim and that is what is being priced into the back end of the market today,” said David Joy at Ameriprise Financial in Boston.

“If we are going to have a similar type of economic environment as we’ve had, then we are going back to an emphasis on trying to find earnings in a relatively scarce earnings environment, back to the same winners as before.”

Unofficially, the Dow Jones Industrial Average rose 371.42 points, or 1.35 per cent, to 27,851.45, the S&P 500 gained 74.3 points, or 2.21 per cent, to 3,443.46 and the Nasdaq Composite added 427.53 points, or 3.83 per cent, to 11,588.10.

The S&P healthcare index jumped to a record high, while the information technology sector also gained strongly, as a divided Congress means slimmer chances for heightened antitrust scrutiny, capital gains taxes and a restoration of parts of the Affordable Care Act.

The healthcare index was on track for its biggest daily percentage gain in about five months.

Still, with the rising possibility of a contested presidential election, investors have said they favour a definitive, swift resolution that would clear the way for a deal on a stimulus package to help revive the economy.

The NYSE FANG+TM Index, which includes the core FAANG stocks such as Apple and Amazon jumped.

Shares of defense contractors Northrop Grumman, Lockheed Martin and Raytheon all rose between on receding chances of a cut in the defence budget.

Big Pharma Pfizer, Merck & Co and Johnson & Johnson also climbed as the potentially split Congress was likely to shield the industry from sweeping reform. The NYSE Arca pharmaceutical index shot higher.

The CBOE volatility index, a gauge for short-term volatility, hit a two-week low after spiking to a four-month high in the run-up to the election.

Despite the rally in stocks, the potential for political uncertainty also sent investors to US Treasuries, sparking the biggest one-day drop in 10- and 30-year bond yields since June.

Shares of US banks, which typically track Treasury yields, slumped.