Stocks mostly fell on Friday, tracking an unexpected decline in retail sales that raised concerns about the health of consumers, a key component of the economic recovery.

Consumer-related shares were the hardest hit, with Home Depot down 2.4 percent at $31.93, and Procter & Gamble , down 1.9 percent at $60.72, weighing down the Dow industrials. The S&P retail index <.RLX> dropped 1.1 percent.

Total retail sales marked their first monthly drop in eight months, falling 1.2 percent in May -- contrary to economists' consensus forecast for a gain of 0.2 percent. Consumer spending accounts for roughly two-thirds of U.S. economic activity.

There's an idea that there's a slowdown taking place in the U.S. economy, and data like this is helping that idea gain traction, said John Brady, senior vice president of MF Global in Chicago.

The Dow Jones industrial average <.DJI> dropped 36.58 points, or 0.36 percent, to 10,135.95. The Standard & Poor's 500 Index <.SPX> fell 2.48 points, or 0.23 percent, to 1,084.36. But the Nasdaq Composite Index <.IXIC> gained 7.45 points, or 0.34 percent, to 2,226.16.

Weakness in the building materials component of retail sales pushed the Morgan Stanley housing index <.HGX> down 0.7 percent. Shares of Hovnanian Enterprises Inc fell 5.3 percent to $4.63.

In contrast to the weak retail sales, consumer sentiment improved more than expected, rising to its strongest point in over two years in June, according to a preliminary reading for the month from the Thomson Reuters/University of Michigan Surveys of Consumers.

Also on the economic front, U.S. business inventories rose 0.4 percent to a 10-month high, slightly under the expectation for a 0.5 percent increase.

The Nasdaq rose on strength in semiconductor stocks a day after National Semiconductor Corp forecast margins and revenues above estimates, signaling that demand is bouncing back.

National Semi shares rose 4.9 percent to $14.19 while Altera Corp gained 2.5 percent to $24.25. The PHLX Semiconductor index <.SOXX> added 0.9 percent.

In another bullish sign, the S&P 500 held technical support around the 1,077 level that marks its 14-day simple moving average. The benchmark S&P index is on track for its first back-to-back close above its 14-day SMA in more than two weeks.

And the Dow was on track to post its first weekly gain in the last four.

Big-cap pharmaceutical companies' shares also advanced after Barclays Capital upgraded the sector to positive from neutral, citing the revenue potential of new products.

Pfizer Inc was the Dow's top percentage gainer, rising 3.4 percent to $15.41.

U.S.-listed shares of BP Plc climbed 3.6 percent to $33.95 as UK officials made supportive comments, even as scientists doubled estimates of the Gulf of Mexico's oil spill.

(Reporting by Rodrigo Campos; Additional reporting by Ryan Vlastelica; Editing by Jan Paschal)