NEW YORK — 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 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 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 it still doesn’t signal the all-clear for the economy, said Michael Sheldon, chief market strategist at RDM Financial Group in Westport, Conn.

“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, the first drop in eight months. It surprised economists, who had predicted the pace of growth would slow between April and May but still rise.

Firms dependent on consumer spending fell after the report. Procter & Gamble Co., maker of 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 rose 4 percent, while RIM 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 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.

Analysts say everyday investors 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.