All three major indexes moved sharply higher after U.S. House of Representative Speaker Nancy Pelosi and Treasury Secretary Steven Mnuchin both expressed hope for a breakthrough in partisan stimulus negotiations.

"The real thing that's pushing the markets higher today is hopes for additional stimulus," said Robert Pavlik, chief investment strategist at SlateStone Wealth LLC in New York. "But you combine that with good economic news and throw in quarter-end window dressing, you end up with a market that's up as opposed to where futures were headed last night after the debate."

Market participants were digesting Tuesday's contentious presidential debate, where President Donald Trump and Democratic challenger Joe Biden talked over each other and traded insults as they sparred over Trump's record on the COVID-19 pandemic, healthcare and the economy.

"The debate made it look like we had preschoolers running the country," Pavlik added. "It wasn't a debate it was an argument. It didn't inspire any confidence."

A spate of economic data on Wednesday mostly surprised to the upside, with ADP National Employment index blowing past analyst expectations and pending home sales surging to an all-time high.

The major indexes were on track to wrap up September with their first monthly declines since March, when mandated shutdowns slammed the economy.

But the indexes are expected to show third-quarter gains, with the S&P and the Nasdaq were on course for their biggest two-quarter winning streaks since 2009.

The Dow Jones Industrial Average rose 536.82 points, or 1.96%, to 27,989.48, the S&P 500 gained 54.54 points, or 1.64%, to 3,390.01 and the Nasdaq Composite added 186.02 points, or 1.68%, to 11,271.27.

All 11 major sectors in the S&P 500 were in positive territory, with healthcare and financials enjoying the largest percentage gains.

Moderna Inc rose 3.1% after researchers said the company's COVID-19 vaccine candidate produced encouraging results.

Nikola Corp stock soared by 20.0% after Chief Executive Mark Russell said he was close to a deal with an energy partner and defended the company against a short-seller's fraud allegations.

Micron Technology Inc said it has not yet obtained new licenses needed to sell memory chips to China's Huawei Technologies Co Ltd, sending its shares down 5.7%.

Duke Energy Corp jumped 7.3% after the Wall Street Journal said the company had been approached by peer NextEra Energy Inc regarding a possible takeover. Shares of NextEra Energy fell 1.4%.

Advancing issues outnumbered declining ones on the NYSE by a 2.08-to-1 ratio; on Nasdaq, a 1.87-to-1 ratio favored advancers.

The S&P 500 posted 13 new 52-week highs and no new lows; the Nasdaq Composite recorded 56 new highs and 25 new lows.

By Stephen Culp