The Dow Jones industrial average has logged its first winning week in a month.
The Dow rose 39 points Friday and ended the week with a gain of 2.8 percent, its best weekly advance since mid-February. The market slid in morning trading on disappointing retail sales numbers but started to pare its losses after a report found consumers are gaining confidence in the economy. The market climbed in the last hour of trading to end near the highs of the day.
Treasury prices rose, pushing down interest rates, after spiking on Thursday.
The preliminary Reuters/University of Michigan consumer sentiment index for June showed consumer confidence rose to its highest level since January 2008 and came in well ahead of forecasts. The jump in confidence was an encouraging sign, but still doesn't signal the all-clear for the economy, said Michael Sheldon, chief market strategist at RDM Financial Group in Westport, Conn.
"We recovered some lost ground, but there is still some ways to go," Sheldon said. That was evident in the disappointing retail sales report, which initially sent stocks lower.
The government reported that retail sales fell 1.2 percent in May. It was the first drop in eight months. It was a surprise to economists who had predicted the pace of growth would slow between April and May, but still rise.
Companies dependent on consumer spending fell after the report. Proctor & Gamble Co., which makes Tide detergent and Gillette razors, lost 1.5 percent. J.C.Penney Co. fell 1.1 percent, while Macy's Inc. shares also slipped.
Technology shares got a boost after handset maker Motorola Inc. settled a patent dispute with Research In Motion Ltd. Motorola climbed 4 percent, while Research In Motion added less than 1 percent.
The mixed reports come a day after stocks surged on upbeat global economic figures. The day's swings extended the volatility that has been seen in recent weeks. The Dow climbed 279 points Thursday on reports from China, Japan and Australia that indicated the global economy continues to improve.
Despite the gains Friday, analysts said traders aren't on edge. "The market is nervous," said Joe Heider, principal at Rehmann Financial in Cleveland. "It's reacting on a day-to-day basis."
Heider said the economy is not growing fast enough to overcome the concerns about Europe's debt crisis and other issues such as the oil spill in the Gulf of Mexico. That has led to fluctuations in the market, often within the same day. As it has done for most of the week, the market shifted direction in the final hour of trading Friday.
The Dow rose 38.54, or 0.4 percent, to 10,211.07. It had fallen nearly 90 points in morning trading. The Dow's climb of 279 points, or 2.8 percent, during the week was its best since the week ended Feb. 19.
The Standard & Poor's 500 index rose 4.76, or 0.4 percent, to 1,091.60, while the tech-heavy Nasdaq composite index rose 24.89, or 1.1 percent, to 2,243.60.
For the week, the S&P 500 index rose 2.5 percent and the Nasdaq rose 1.1 percent.
Nearly three stocks rose for every one that fell on the New York Stock Exchange, where consolidated volume came to 4.1 billion shares, compared with 5.2 billion Thursday.
Treasury prices rose as some investors sought safety following the retail sales report. The yield on the benchmark 10-year Treasury note, which moves opposite its price, fell to 3.24 percent from 3.33 percent late Thursday.
Friday's reports follow a trend over the past month showing an uneven recovery, which has added concern to a market that is already struggling with worries about the health of Europe's economy. The Dow has mostly fallen since late April as investors worry about whether debt problems and steep government spending cuts in countries like Greece, Spain, Portugal and Hungary will slow Europe's economy so much that the economic slump would spread around the globe.
The euro's level against other currencies has become a key indicator of confidence in European governments' ability to resolve their fiscal problems. The currency, which is used by 16 countries, was little-changed against the dollar. It stood at $1.2108 late Friday.
Analysts say everyday investors, in particular, are still nervous about the market and economy, and are sitting on the sidelines. That leaves institutional investors as the main players in the stock market, which explains why volatility has been so high.
Institutional traders' "sense of long-term holding is in minutes," said Bob Tull, chief operating officer of Old Mutual Global Index Trackers. The quick trades and constant movement of professional money managers means stocks are bound to gyrate more than if there is a steady flow of cash from retail investors heading into the market.
Proctor & Gamble fell 90 cents to $61.01. J.C.Penney dropped 28 cents to $25.99, while Macy's fell 4 cents to $21.24.
Motorola rose 27 cents to $7.11. Research in Motion shares rose 39 cents to $59.50.
Crude oil fell $1.70 to $73.78 per barrel on the New York Mercantile Exchange.
The Russell 2000 index of smaller companies rose 9.21, or 1.4 percent, to 649.00. For the week, the Russell rose 2.8 percent.
Britain's FTSE 100 rose 0.6 percent, Germany's DAX index fell 0.1 percent, and France's CAC-40 rose 1.1 percent. Japan's Nikkei stock average rose 1.7 percent.