A better than expected retail sales report reversed a two-week slump in the stock market Tuesday, sending indexes higher for only the third day this month.
The Dow Jones industrial average jumped back above 12,000 and all three indexes had their best day so far in June.
The government said retail sales edged down 0.2 percent last month. Analysts had expected worse. Excluding weak car sales, retail sales rose 0.3 percent. Americans bought fewer cars during the month, but that was more a reflection of temporary supply chain disruptions caused by the earthquake and tsunami disaster in Japan.
"The good news is the consumer is hanging in there," said Rob Lutts, president and chief investment officer of Cabot Money Management.
The stronger report on retail sales sent the stocks of department stores and other retailers higher. Nordstrom Inc. and Home Depot Inc. rose 4 percent. J.C. Penney Co. jumped 17 percent after the department store chain named Ron Johnson, the man who pioneered Apple Inc.'s retail stores, as its next CEO. J.C. Penny's stock rose the most of any company in the S&P 500.
The Dow Jones industrial average rose 123.14 points, or 1 percent, to close at 12,076.11.
The Standard & Poor's 500 index rose 16.04, or 1.3 percent, to 1,287.87. The Nasdaq composite index rose 39.03, or 1.5 percent, to 2,678.72.
Five stocks rose for every one that fell on the New York Stock Exchange.
The government also reported that wholesale prices rose in May by the smallest amount in 10 months. That helped to allay concerns among investors that rising food and energy costs would slow the economic recovery.
Stocks have tanked over the past two weeks on concerns that the economy is losing strength. The manufacturing industry is slowing, home sales are weak and the job market remains sluggish. Investors are also nervous because the Federal Reserve's $600 billion bond-buying program is winding down at the end of June. The program was aimed at keeping interest rates low to encourage borrowing.
The Dow and S&P 500 have lost 4 percent so far this month. The Nasdaq composite has lost 5 percent.
In corporate news, Best Buy Co. Inc. rose 5 percent after the company reported first-quarter results that beat analysts' forecasts. The company reaffirmed its full-year earnings forecast and said revenue would come in at the high end of the $51 billion to $52.5 billion range it has been expecting.
Energy stocks rose 2 percent, the most of the 10 company groups that make up the S&P 500, after oil climbed back above $99 a barrel. Energy stocks have fallen 9 percent since the S&P 500 peaked in late April, making them appear relatively cheap compared to other industries that hadn't fallen as much.
Consolidated trading volume on the New York Stock Exchange was 3.7 billion shares.