(AP) -- Stocks closed broadly higher on Wall Street Monday, sending the S&P 500 and Nasdaq indexes to all-time highs.
Technology stocks accounted for much of the rally, which added to the market's gains from last week. Retailers, restaurant chains and other companies that rely on consumer spending also notched solid gains.
Traders also shifted money into U.S. government bonds, sending yields lower, and they bid up the price of gold. Both can signal uneasiness in the market. Investors mostly shunned energy and materials stocks , which depend upon economic growth more than other sectors do.
The latest gyrations in the market come as investors weigh encouraging U.S. economic data and company earnings against lingering uncertainty over the potential global economic fallout from the virus outbreak in China.
"If this virus didn't exist, there would be a lot of good things for the market to hang on to," said Brian Nick, chief investment strategist at Nuveen. "It's prudent that you'd be paring back your cyclical bets, while trying to maintain a posture that will still benefit from what we think was going to be a positive year for the global economy and the markets."
The S&P 500 index gained 24.38 points, or 0.7%, to 3,352.09. The index's set record highs twice last week. The Dow Jones Industrial Average rose 174.31 points, or 0.6%, to 29,276.82.
The Nasdaq climbed 107.88 points, or 1.1%, to 9,628.39. The Russell 2000 index of smaller company stocks picked up 10.89 points, or 0.7%, to 1,667.67.
Markets in Europe and Asia closed mostly lower.
The yield on the 10-year Treasury edged lower to 1.56% from 1.57% late Friday.
Wall Street kicked off this week following the biggest weekly gain for the benchmark S&P 500 index since June. Stronger-than-expected company earnings reports and solid economic data on hiring have helped assuage traders' fears over the virus outbreak in China. Investors are also feeling hopeful that central banks and governments around the world can support markets with rate cuts and stimulus.
Businesses around the world are continuing to feel the impact of the new corona virus. Sony and Amazon became the latest companies to pull out of a major European technology show due to fears over the outbreak.
The virus has now infected more than 40,600 people, with most of those cases and almost all the deaths occurring in China. The world's second-largest economy has been taking more measures to soften the economic blow, including funding low-interest loans to businesses while promising tax cuts and subsidies.
"It seems like whatever kind of momentum there might have been in the global economy has been arrested for now," said Nick. "And, if you do see a stabilization, it's going to be a delayed one that probably takes place more in the second quarter or third quarter."
I nvestors continued to bet that stocks, particularly technology companies, will weather any economic bumps from the outbreak. Chipmakers led the sector's gains Monday. Advanced Micro Devices climbed 5% and Nvidia rose 4.5%. Microsoft added 2.6%.
Amazon led a rally in consumer-focused companies, which include restaurant chains, homebuilders and car dealership operators. The online retail giant rose 2.7%. Home Depot climbed 1.4%.
Strong earnings helped push Botox maker Allergan 1.3% higher.
Exxon Mobil dropped 1.1% along with most other energy stocks after U.S. crude oil fell 1.5%.
Taubman Centers soared 53.2% after the mall operator agreed to be acquired by rival Simon Property Group in a deal valued at around $3.6 billion. Taubman manages or leases 26 shopping centers in the U.S. and Asia. Simon, the nation's largest operator of shopping malls, owns or has a stake in 204 properties in the U.S. Shares in Simon rose 1.4%.
Edgewell Personal Care surged 27.5% after the owner of Schick razors said it would end its $1.37 billion buyout pursuit for upstart shaving company Harry's. Edgewell, the No. 2 razor maker in the U.S., behind Gillette, made the decision shortly after the Federal Trade Commission sued to block the sale.
Xerox rose 1.4% after the copier maker raised its offer for computer and printer maker HP to nearly $35 billion. HP, which rose 0.8%, had rejected a prior bid that it considered too low. Both companies are struggling as the demand for printed documents and ink have waned, and both are cutting costs.
Companies are more than halfway through their latest round of earnings and 65 companies in the S&P 500 will report this week. Toy maker Hasbro and hotel operator Hilton will release results on Tuesday. CVS Health will release its results on Wednesday and Kraft Heinz will report earnings on Thursday.
Investors will also have several economic reports to consider this week, including the government's consumer price index update for January, along with retail sales and industrial production reports.
Benchmark crude oil fell 75 cents to settle at $49.57 a barrel. Brent crude oil, the international standard, dropped $1.20 to close at $53.27 a barrel. Wholesale gasoline was unchanged at $1.52 per gallon. Heating oil fell 3 cents to $1.61 per gallon. Natural gas fell 9 cents to $1.77 per 1,000 cubic feet.
Gold rose $6.10 to $1,574.70 per ounce, silver rose 10 cents to $17.76 per ounce and copper was unchanged at $2.56 per pound.
The dollar fell to 109.70 Japanese yen from 109.74 yen on Friday. The euro weakened to $1.0914 from $1.0946.