Stocks gave up most of their gains on Friday after initially spiking to 10-month highs as weak consumer sentiment data offset an upbeat forecast from chipmaker Intel and better-than-expected profit from computer maker Dell.

A Reuters/University of Michigan survey showed consumer confidence fell to its lowest in four months in August on worries over high unemployment and dismal personal finances, though the mood improved from earlier this month.

The Nasdaq was buoyed after Intel Corp raised its outlook for third-quarter revenue and Dell Inc , the world's No. 2 personal computer maker behind Hewlett-Packard Co , posted a strong quarterly performance and several brokerages raised their price target on the stock.

The PHLX semiconductor index <.SOXX> rose 2.2 percent, while Dell shot up 4 percent to $16.29, and Intel increased 4.6 percent to $20.36.

You would think after the Intel blowout numbers the market would have really picked up a lot of steam, said Angel Mata, managing director of listed equity trading at Stifel Nicolaus Capital Markets in Baltimore.

It's just telling you that this market has about as much good news baked into as it can take. We're at that point now where there is no more good news that could come out that can really juice this market.

The Dow Jones industrial average <.DJI> dropped 30.39 points, or 0.32 percent, to 9,550.24. The Standard & Poor's 500 Index <.SPX> shed 0.77 points, or 0.07 percent, to 1,030.21. The Nasdaq Composite Index <.IXIC> gained 6.39 points, or 0.32 percent, to 2,034.12.

The Dow industrials were weighed down by declines in consumer companies like McDonald's Corp , off 1.2 percent to $56.

Shares of Apple Inc rose 0.5 percent to $170.26 after China Unicom <0762.HK>, China's No. 2 mobile carrier, agreed to sell the iPhone in China, giving Apple access to the world's largest mobile market. China Unicom's U.S.-listed shares gained 4.1 percent to $14.66.

Earlier Friday, the government said U.S. consumer spending rose as expected in July, lifted by the cash-for-clunkers program that fueled demand for autos.

After the market open, the S&P 500 rose to 1,039.47, its highest intraday reading since October 14, 2008.

(Reporting by Rodrigo Campos; Additional reporting by Chuck Mikolajczak; Editing by Jeffrey Benkoe)