The Dow Jones industrial average ended the day 99.22 points, or 0.7 percent, higher at 13,979.30, erasing a large part of its loss from Monday. The index traded above 14,000 during the day before falling back in the last hour.
The rise follows two days of whiplash. On Monday, the Dow dropped 129 points, its worst sell-off of the year so far, as fears about Europe's finances resurfaced. That drop came after the index gained 149 points Friday, closing above 14,000 for the first time since 2007.
After strong gains for stocks this year, investors are wondering whether they should sell now, or wait and see if the rally still has legs, said Brad Reynolds, chief investment officer at LJPR, Inc.
"The market is extremely skittish right now, that's why we're seeing such big moves," said Reynolds.
Tuesday's advance was driven by new data showing that U.S. home prices rose in December at the fastest pace in more than six years. CoreLogic, a real estate data provider, reported that home prices rose 8.3 percent. In Europe, a measure of manufacturing and service businesses rose to a 10-month high January.
Estee Lauder rose $3.66, or 6 percent, to $64.71 after reporting earnings that beat analysts' expectations. Profits surged 13 percent at the beauty products company as sales in the U.S. and emerging markets rose. Computer Sciences Corp., an information technology services company, was the biggest gainer in the S&P 500. CSC rose $3.84, or 9.2 percent, to $45.75 after the company said it was raising its earnings outlook for the year because its cost-cutting efforts were yielding better results than it had expected.
Stocks have gotten off to a strong start this year. The Dow advanced 5.8 percent in January, its best start to the year since 1994, according to data compiled to S&P Dow Jones indices. The S&P 500 rose 5 percent last month.
Lance Roberts, chief economist at Streettalk Advisors in Houston, Texas, said that's related more to the Federal Reserve's commitment to keep money cheap than to companies' performance. If earnings are beating estimates, he said, it's largely because expectations were so low.
"If you lower the hurdles enough, companies can get over them," Roberts said.
The fact that individual investors are starting to return to stocks, as they have in recent weeks, is another sign that the market is due for a correction, Roberts and other analysts have said.
McGraw-Hill Cos., parent of the Standard & Poor's ratings agency, fell $5.38, or 10.7 percent, to $44.92, after the federal government sued S&P. The government said that S&P knowingly misled investors about the quality of the mortgage-backed securities it was rating in the run-up to the financial crisis that caused the Great Recession. The stock dropped 14 percent on Monday after early reports about the lawsuit leaked out.
The yield on the 10-year Treasury note, which moves inversely to its price, climbed four basis points to 2 percent.
Other stocks making big moves;
— Cereal maker Kellogg gained 40 cents, or 0.7 percent, to $58.50, after reporting fourth-quarter results. It booked a loss because of a pension-related charge, but underlying earnings rose, helped partly by the company's recent purchase of Pringles chips.
— Dell, the struggling computer giant, rose 15 cents, or 1.1 percent, to $13.47 after the company announced a $24.4 billion buyout deal led by founder Michael Dell that will take the company private at $13.65 a share.
— Yum Brands, parent of KFC, Pizza Hut and Taco Bell, fell $1.86, or 2.9 percent, to $62.08 after the company warned late Monday that 2013 profits could decline as it continues to reel from a controversy over its chicken suppliers in China.
— Archer Daniel Midland, a company that makes food ingredients and animal feed, gained 94 cents, or 3.3 percent, to $29.38 after its earnings jumped in the last quarter following a restructuring.