Investors remained in a buying mood on Election Day, sending US stocks broadly higher and building on big gains from a day earlier.
Safe-play stocks such as utilities and phone companies were among the biggest gainers on Tuesday. Energy companies were essentially flat.
Investors focused on the US presidential election, which rattled financial markets in recent weeks as polls between Hillary Clinton and Donald Trump tightened.
Wall Street has largely seen Mrs Clinton as more likely to maintain the status quo, while viewing Mr Trump's polices as less clear. Tuesday's rally, coupled with Monday's market gains, which marked the end of a nine-day losing streak and the best day for stocks since March, suggest the market anticipated a Clinton win.
"The market has been looking for the status quo result, and the polling in the last couple of days shows that result is a good likelihood," said Mike Baele, senior portfolio manager at the Private Client Reserve at US Bank. "That's the reason why the market is bouncing here."
The Dow Jones industrial average rose 73.14 points, or 0.4%, to 18,332.74. The average was briefly up as much as 140 points. The Standard & Poor's 500 index gained 8.04 points, or 0.4%, to 2,139.56. The Nasdaq composite index added 27.32 points, or 0.5%, to 5,193.49.
Trading got off to a downbeat start, weighed down by disappointing earnings from Valeant Pharmaceuticals, CVS Health and other companies. But the market recovered by mid-morning as investors' sized up news reports on early voting trends.
Mrs Clinton entered Election Day with multiple paths to victory, while Mr Trump needed to prevail in most of the battleground states to reach 270 Electoral College votes. Control of the Senate was also at stake.
Investors have been expecting Mrs Clinton to win the presidency, the Democrats to take back the Senate and the Republicans to hold on to the House of Representatives, said Erik Davidson, chief investment officer for Wells Fargo Private Bank.
"That's sort of the base case," he said. "A Trump victory, the markets are not fully ready for that. That could certainly cause some volatility in the markets tomorrow if we have that outcome, and if it's conclusive."
Beyond the election, investors monitored the latest batch of company earnings.
Priceline Group climbed 6.6% after the online travel booking company reported quarterly earnings that easily beat analysts' forecasts. The stock gained 97.80 dollars to 1,578.13 dollars.
Marriott International gained 2.7% after the hotel chain posted a big increase in earnings and revenue for the most recent quarter. The stock added 1.92 to 73.02 dollars.
SeaWorld Entertainment jumped 8.1% after the embattled parks operator said it has been able to stem falling attendance after a bruising fight with animal rights activists that led to the closure of its orca breeding programme. The stock gained 1.16 to 15.41 dollars.
Other companies' latest quarterly report cards failed to impress investors.
Hertz plunged 22.5% after the car rental company's latest quarterly earnings came up far short of what analysts anticipated. The stock, which was down more than 50% at one point, slid 8.04 to 27.70 dollars.
CVS Health tumbled 11.8% after the drugstore chain and pharmacy benefits manager's third-quarter revenue fell short of Wall Street's expectations. The company also trimmed its outlook. The stock shed 9.86 to 73.53 dollars.
Depomed sank 17% after the drugmaker reported lower-than-anticipated quarterly earnings. The stock dropped 3.88 to 19.01 dollars.
Valeant Pharmaceuticals International slumped 21.7% after the Canadian drugmaker reported a third-quarter loss. The company also slashed its guidance as it continues to face scrutiny over its business practices. The stock lost 4.15 to 14.98 dollars.
Markets overseas closed mostly higher. In Europe, Germany's Dax rose 0.2%, while France's CAC-40 gained 0.4%. London's FTSE 100 added 0.5%. Earlier in Asia, stock indexes closed mostly higher. Hong Kong's Hang Seng rose 0.5%, while Seoul's Kospi added 0.3%. Tokyo's Nikkei 225 was little changed.
Benchmark US crude rose nine cents to close at 44.98 dollars a barrel in New York. Brent crude, used to price international oils, slid 11 cents to close at 46.04 dollars a barrel in London. Other energy futures were also mixed. Wholesale petrol was little changed at 1.37 dollars a gallon. Heating oil also held steady at 1.44 dollars a gallon. Natural gas fell 18 cents, or 6.5%, to 2.63 dollars per 1,000 cubic feet.
In metals trading, the price of gold slid 4.90 to 1,274.50 dollars an ounce, while silver gained 21 cents, or 1.1%, to 18.36 dollars an ounce. Copper added seven cents, or 3.1%, to 2.38 dollars a pound.
Bond prices fell. The yield on the 10-year Treasury note rose to 1.86% from 1.83% late on Monday.
In currency markets, the dollar rose to 105.05 yen from 104.58 yen. The euro weakened to 1.1016 from 1.1040 dollars. The Mexican peso, which has become an indirect proxy among investors for Mr Trump's chances to win the White House, rose against the dollar. The US currency fell to 18.42 Mexican pesos from 18.68 pesos.