Updated

Stocks ended the session higher Monday as investors optimistically digested an impressive upgrade for the price target of Apple shares and oil prices that dipped slightly after climbing earlier on concerns about instability in Iraq.

The Dow Jones industrial average gained 32.51 points, or 0.31 percent, to close at 10,489.42. The technology-laced Nasdaq Composite Index was up 14.56 points, or 0.70 percent, at 2,085.19, while the broader Standard & Poor's 500 index was higher 6.90 points, or 0.59 percent, to end at 1,177.24.

Higher crude prices weighed on stocks earlier in the session because of their impact on corporate profits and consumer spending. A barrel of light crude was quoted at $48.50, down 39 cents, on the New York Mercantile Exchange (search). It rose as high as $49.55 on Monday.

Meanwhile, the dollar slid back toward last week's record low against the euro. A communique issued by the Group of 20 nations on Sunday made no explicit reference to currency swings, despite mounting concern in Europe and Japan over the dollar's slide and ballooning U.S. deficits.

The euro is up 0.18 percent against the dollar from late Friday levels in New York. One euro is buying about $1.3040 .

Stocks were down most of the session on fears that the economy could slow down further, spurred by Federal Reserve Chairman Alan Greenspan's warnings Friday that the U.S. budget deficit and trade deficit were causing undue pressure on the U.S. dollar and the economy.

"There's a lot of macroeconomic issues around that aren't going to be easily resolved, and that has investors' attention," said Jay Suskind, head trader at Ryan Beck & Co. "It's not really a sense of uneasiness, but more that there are some headwinds out there to continued growth."

Amid a light schedule for corporate news, struggling doughnut shop chain Krispy Kreme Doughnuts Inc. (KKD) reported a quarterly net loss because of impairment charges and store closing costs. Krispy Kreme shares fell $1.86 to $9.64. The stock hit a 52-week low of $9.37 earlier in the session.

However, not all was gloomy after Piper Jaffray raised its price target on Nasdaq component Apple Computer Inc.'s (AAPL) stock to $100 from $52. Shares were up $6.18, or 11.20 percent, at $61.35.

In other corporate news, Oracle Corp. (ORCL) slipped 7 cents to $12.68 after 61 percent of PeopleSoft Inc. (PSFT) shareholders agreed to Oracle's $24 per share takeover bid. However, PeopleSoft's board said the offer remains inadequate, setting the stage for a bruising takeover battle. PeopleSoft rose 19 cents to $23.36.

The board of Mylan Labs Inc. (MYL) rejected investor Carl Icahn's $5.4 billion offer to purchase the company, calling it a "self-serving" effort to intimidate the generic drug maker as it prepares to purchase rival King Pharmaceuticals Inc. (KG) Mylan skidded 23 cents to $18.65 while King climbed 14 cents to $11.29.

Shares of Internet search company Google Inc. (GOOG) fell 2.5 percent to $165.10 after its co-founders and chief executive outlined plans to sell sizable holdings in the company.

Campbell Soup Co. (CPB), the maker of Chunky soup, Pepperidge Farm cookies and Godiva chocolate, posted higher quarterly profit. Its shares rose nearly 5 percent to $28.71 on the NYSE.

Shares of Forest Laboratories Inc. (FRX) fell after Banc of America Securities cut its rating to "sell" from "neutral" due to risks associated with the Lexapro trial and the earlier-than-expected entrance of a generic for its antidepressant Celexa. The stock was down more than 8 percent, falling $3.49 to $36.80.

Trading was active, with 1.4 billion shares changing hands on the New York Stock Exchange, equal to the 1.4 billion daily average for last year. About 1.9 billion shares were traded on Nasdaq, higher than the 1.69 billion daily average last year. Advancing issues outnumbered decliners by about 2 to 1 on the New York Stock Exchange.

The Russell 2000 index of smaller companies was up 8.08, or 1.32 percent, at 621.52.

Overseas, Japan's Nikkei stock average tumbled 2.11 percent. In Europe, Britain's FTSE 100 closed down 0.58 percent, France's CAC-40 dropped 0.65 percent for the session and Germany's DAX index fell 0.26 percent.

Reuters and The Associated Press contributed to this report.