By Michael Wursthorn and Joe Wallace

U.S. stocks had their best day after a presidential election on record, propelled by a rally in technology shares, as investors appeared to coalesce around the idea of a divided government.

Although the outcome of the presidential election remained uncertain as crucial battleground states continued to tally votes, neither Republicans or Democrats received a clear mandate from voters that would preface broad policy changes.

With little else certain, investors appeared to shy away from the "blue-wave trade" -- buying shares of economically sensitive companies -- that had gained traction ahead of the election on expectations for further economic aid. Instead, investors reverted back to snapping up the stock market's most enduring winners, shares of technology companies.

"The trade going into this was anticipating a blue wave," said RJ Grant, a director of equity trading at KBW Inc. "Now, it looks like there's going to be more political gridlock."

The broad S&P 500 index gained 74.42 points, or 2.2%, to 3443.44, its biggest one-day point and percentage increase since June. That gain topped its performance from 1980 when the index climbed 1.8% in what had previously been the biggest postelection rally on record.

The Dow Jones Industrial Averaged added 367.63 points, or 1.3%, to 27847.66. And the tech-heavy Nasdaq Composite jumped even higher, gaining 430.21 points, or 3.9%, to 11590.78, its strongest performance in nearly eight months.

All three indexes pulled back from highs set earlier in the session.

So far, Republicans appeared poised to remain in control of the Senate, while the odds of former Vice President Joe Biden topping President Trump in the electoral count brightened. Democrats, meanwhile, will likely keep control of the House, but with a slimmer margin. Those outcomes are sure to hamper any ability by Democrats to push a progressive agenda, including changes to taxes, health care and how tech companies are regulated.

But those developments also throw a wrench into an easy pathway for additional fiscal stimulus that some analysts say is needed to help the economy recover from the damage wrought by the coronavirus pandemic.

Rob Manning, senior managing director and head of trading at Evercore ISI, said many of the firm's hedge-fund clients on Wednesday were buyers of shares of technology, communication services and even health-care stocks. That was a reversal from last week when hedge funds were net sellers of technology stocks and net buyers of value-oriented companies, including those in the industrial, financial and real-estate sectors.

He added the firm's derivatives traders saw many investors unwind the hedges they had placed on tech stocks to protect against any election uncertainty as well as a Democratic sweep.

"We're seeing a move back into what has worked in the market this year," Mr. Manning said.

Investors also scooped up government bonds, pushing yields on the benchmark 10-year U.S. Treasury note down by their biggest margin since mid-April, further suggesting investors' stimulus expectations have fallen. A measure of volatility, the Cboe Volatility Index, or VIX, receded, falling 17%.

The stock market's solid gains followed a wild night of off-hours trading. S&P 500 futures had briefly turned red after President Trump accused Democrats of trying to disenfranchise his voters and promised to petition the Supreme Court, though he didn't elaborate. They turned positive again after counts in Wisconsin and Michigan pointed toward possible wins for Mr. Biden.

"The market has been underpricing the chance of a close result," said Seema Shah, chief strategist at Principal Global Investors. "I'm surprised U.S. equities are doing as well as they are," she added, saying she expected to see more wild swings in stock prices in the near term.

Despite the volatility, traders described Wednesday's action as orderly, saying investors largely avoided making outsize bets one way or another ahead of the election, instead opting for hedges to protect portfolios. Many tried to avoid the scenario in 2016 where they were caught flat footed in the wake of President Trump's victory.

Still, the lack of a decisive result will likely keep investors on edge.

Money managers had long pinpointed a drawn-out or contested result as having the potential to spark big swings in asset prices. During the 2000 election dispute, for example, the S&P 500 fell about 4% between the election date and the Supreme Court ruling in mid-December that settled the matter.

"Markets don't want to see this long protracted multiple-week scenario play out. The market won't like that at all," said Doron Barness, a senior managing director and global head of cash equities trading and distribution at Oppenheimer & Co.

Among the big technology stocks that powered the indexes higher, shares of Apple, the most valuable company in the U.S., rose more than 4%, while Amazon.com and Google owner Alphabet notched gains north of 6% and 8%, respectively.

Among other movers, shares of Uber Technologies added $5.22, or 15%, to $40.99 and Lyft gained $2.96, or 11%, to $29.19 after California voters approved an initiative that let the ride-hailing firms count their drivers as independent contractors.

Shares of Biogen surged $108.62, or 44%, to $355.63 after the U.S. Food and Drug Administration appeared to give a positive assessment of the company's experimental Alzheimer's disease drug.

Meanwhile, shares of banks, which are closely tied to the outlook for the economy and tend to suffer when longer-term bond yields fall, notched declines.

Small-cap stocks, which are more exposed to economic growth and were more likely to benefit from another government spending package, broadly declined, another sign that stimulus hopes have waned. The Russell 2000 index of smaller stocks swung between small gains and losses before closing flat.

The sideways trading among small caps came even after Senate Majority Leader Mitch McConnell said Wednesday that Congress should pass a new economic-relief package this year.

Without the cushion of additional stimulus, the economy will remain more exposed to the trajectory of the coronavirus, said Anna Rathbun, chief investment officer at CBIZ Investment Advisory Services.

"That's why we may see more of the same market patterns that we did maybe over the summer, maybe early fall, where we have ailing cyclicals, Treasury yields might remain depressed and small caps would in that scenario also struggle," she added.

--Mischa Frankl-Duval and Karen Langley contributed to this article.

Write to Michael Wursthorn at Michael.Wursthorn@wsj.com and Joe Wallace at Joe.Wallace@wsj.com

(END) Dow Jones Newswires

11-04-20 1724ET