Updated

Stocks rose Thursday, recovering from early losses, as an upbeat earnings report from chipmaker National Semiconductor (NSM) helped offset rising oil prices, an unexpected jump in unemployment claims and a batch of sales warnings.

The Dow Jones industrial average (search) was up 58.59 points, or 0.56 percent, at 10,552.82. The Standard & Poor's 500 Index (search) was up 6.43 points, or 0.54 percent, at 1,189.24. The technology-laced Nasdaq Composite Index (search) was up 2.90 points, or 0.14 percent, at 2,129.01.

National Semiconductor's 22 percent rise in quarterly profits also offset poor sales figures from two other semiconductor makers and helped tech shares post small gains. The markets were headed substantially lower in early trading, due to the troubling economic data, before the chip maker released its earnings report.

"You saw the markets just turn right around after National Semi released their figures," said Keith Keenan, vice president of institutional trading at Wall Street Access. "That helped restore a little optimism in the market, but there's still a lot to be worried about. This could be pretty short-lived."

Procter & Gamble Co. (PG) pulled blue chips higher a day after the consumer products maker boosted its sales forecast for fiscal 2005 and said full-year earnings would hit the high end of Wall Street estimates. It rose 2 percent, or $1.35, to $56.38.

"There seems to be a consensus that we're due for a year-end rally, and weakness is considered an opportunity to buy," said Michael Metz, chief investment strategist at Oppenheimer & Co.

National Semiconductor's shares jumped 5 percent, or 79 cents, to $16.79, after the S&P 500 index component said profit rose and that problems with excess inventory in the distribution channel were behind it.

That helped offset the impact of reports from chip makers Altera Corp. (ALTR) and Xilinx Inc. (XLNX), who late Wednesday cut quarterly sales forecasts. Altera fell 10 percent to $19.95, while Xilinx was 3.5 percent lower at $29.66.

Among other movers, telecommunications equipment maker Ciena Corp. (CIEN) surged 23 percent, or 54 cents, to $2.88 after posting better-than-expected revenues. Nextel (NXTL) was the biggest gainer by index points on the Nasdaq, while Sprint (FON) was the third biggest upward influence on the S&P.

The number of Americans filing initial claims for jobless pay grew unexpectedly last week to 357,000, Labor Department (search) data showed Thursday, but an official said an increase in the week after a public holiday was typical. The department also said the price of goods imported into the United States in November rose 0.2 percent, slightly more than expected.

The surprise climb added to lingering concerns about the job market from Friday's disappointing job creation report.

Investors remained cautious as crude oil futures rose for the second straight day, pushing past the $42-per-barrel mark. The market fretted about whether a small build in U.S. heating oil stocks was enough to last the winter, and pondered word from Kuwait's oil minister Sheik Ahmad Fahad Al-Ahmad Al Sabah that OPEC may cut production early in 2005.

A barrel of light crude for January delivery settled at $42.53, up 59 cents, on the New York Mercantile Exchange (search).

But the dollar clung to small gains as traders adjusted their positions and held tightly to whatever profits they have made this year. The dollar has been on a downward path, causing concerns for investors, as a weak greenback dissuades foreign investment in US assets.

"There's a feeling that the worst for the dollar is behind us, at least short term and this is positive for the equity market," said Metz.

Luxury home builder Toll Brothers Inc. (TOL) surged $6.88 to $60.99 after profits soared 93 percent in the quarter and the company surpassed earnings forecasts by 25 cents per share.

Dow component McDonald's Corp. (MCD) gained 28 cents to $31.78. It reported sales at stores open at least a year rose 4.2 percent in November, with U.S. stores making the most gains.

DreamWorks Animation SKG Inc. (DWA), in its first quarterly earnings report since going public, beat Wall Street profit forecasts by a penny per share, but disappointed Wall Street by pushing back the release of "Shrek 3" by six months, to May 2007. DreamWorks Animation dropped $2.51 to $37.69.

Discount bulk retailer Costco Wholesale Corp. (COST) slid 80 cents to $48.10 after the company's quarterly sales and earnings reports were in line with Wall Street expectations, but future guidance remained cloudy.

Trading was heavy, with 1.6 billion shares changing hands on the New York Stock Exchange, above the 1.4 billion daily average for last year. About 2.26 billion shares were traded on Nasdaq, above the 1.69 billion daily average last year.

Advancers outnumbered decliners on the NYSE by about 6 to 5, while decliners outnumbered advancers by about 9 to 7 on Nasdaq.

The Russell 2000 index of smaller companies was down 1.96, or 0.31 percent, at 629.19.

Overseas, Japan's Nikkei stock average fell 1.51 percent. In Europe, Britain's FTSE 100 closed down 0.33 percent, France's CAC-40 lost 0.73 percent for the session, and Germany's DAX index dropped 1.21 percent.

Reuters and the Associated Press contributed to this report.