NEW YORK (

TheStreet

) -- Stocks finished higher Thursday, erasing initial losses as commodities and commodity stocks rebounded, helped by a weaker dollar.

The

Dow Jones Industrial Average

gained 66 points, or 0.5%, to close at 12,695. The

S&P 500

finished higher by more than 6 points, or 0.5%, at 1348, while the

Nasdaq

gained 18 points, or 0.6%, to close at 2863.

Defensive stocks were in favor Thursday, with

IBM

(IBM) - Get Report

,

Merck

(MRK) - Get Report

,

Pfizer

(PFE) - Get Report

,

Procter & Gamble

(PG) - Get Report

and

Kraft Foods

(KFT)

gaining the most on the Dow.

Cisco Systems

(CSCO) - Get Report

was the Dow's biggest laggard after the

networking technology company reported better-than-expected third-quarter earnings late Wednesday but gave disappointing guidance for the fourth quarter. The stock was dropping 4.5% to $16.98.

Caterpillar

(CAT) - Get Report

,

JPMorgan Chase

(JPM) - Get Report

and

American Express

(AXP) - Get Report

were also among the Dow's weakest stocks.

Stocks traded weakly in the early part of the trading session, with energy stocks coming under pressure after the

International Energy Agency cut its 2011 forecast for global oil product demand growth, pointing to high prices and weak economic growth projections for advanced economies.

The Chinese central bank also raised its reserve requirement for the fifth time this year, further hurting commodity stocks.

By midafternoon, however, the pressure on commodity and commodity stocks began to ease, as oil prices resumed their climb and the dollar weakened. That, in turn, lifted markets.

The dollar index was last down by 0.1%.

The June

crude oil contract reversed earlier losses, adding 76 cents to settle at $98.97 a barrel.

Gold for June delivery rose by $5.50 to settle at $1,506.60 an ounce.

Commodity bulls appeared to have seen the selloff in the last two sessions as overdone. Barclays Capital analyst Amrita Sen acknowledged that higher gasoline prices are hurting demand, but said the impact isn't as significant as in 2008 -- the last time consumers saw gasoline prices near current levels.

"Overall, the global demand picture has not changed significantly, and although U.S. oil demand is showing slower growth no doubt, non-OECD

emerging market oil demand remains robust," Sen said in a recent note.

Oil stocks were also in focus as executives from

Exxon Mobil

(XOM) - Get Report

TST Recommends

,

Chevron

(CVX) - Get Report

,

ConocoPhillips

(COP) - Get Report

,

BP

(BP) - Get Report

and

Royal Dutch Shell

(RDS.A)

appeared

before the Senate Finance Committee in a hearing

to defend energy tax breaks. Most of the big oil majors traded weakly.

Also in Washington,

Federal Reserve

Chairman Ben Bernanke appeared before the Senate Banking Committee to push for tougher rules for "systematically important" financial institutions to protect against a widespread collapse of the financial system.

Economic data Thursday was less than impressive.

Initial jobless claims shed 44,000, to 434,000 in the week ended May 7 from the prior week's level of 478,000. Economists had anticipated a drop of 51,000 claims to 423,000, after the prior week's initially reported level of 478,000, according to Briefing.com.

Prices at the producer level rose by 0.8% in April, exceeding the 0.5% uptick that economists had been expecting, after growth of 0.7% in March. The core rate, which excludes volatile food and energy costs, rose 0.3%, compared with the increase of 0.2% that the market had been expecting, and growth of 0.3% in March.

April retail sales grew 0.5%, which was lighter than an expected gain of 0.6% and growth of 0.9% in March. Excluding autos, sales rose 0.6%, nearly meeting expectations for growth of 0.5% and well below March's jump of 1.2%.

The Commerce Department said business inventories jumped 1% in March, largely meeting expectations for an increase of 0.9%. In February, inventories gained 0.7%.

"I think that some of the data that we got today was a little consistent with hints that growth may come at a slower pace than had been expected earlier in the year," said Josh Feinman, global chief economist at Deutsche Bank's DB Advisors. "Retail sales were OK, showing some of the impact from higher gas prices, but jobless claims numbers have been a little worrisome lately. And I don't think that all of the weakness can be ascribed to technical factors."

Shares of

Goldman Sachs

(GS) - Get Report

shed 3.5% to $142.75 after

Rochdale securities analyst Richard Bove downgraded the stock to sell from neutral and cut its price target to $120 from $163. A Standard and Poor's equity analyst also lowered the price target on the threat of a material lawsuit from the Department of Justice.

Clearwire

(CLWR)

saw its stock slump 15.6% to $3.99 after

Intel

(INTC) - Get Report

disclosed plans to sell 10 million shares of the wireless broadband provider's Class A common stock in the open market.

Department store operator

Kohl's

(KSS) - Get Report

topped analysts' first-quarter profit estimates by a penny with earnings of 73 cents a share. The stock added 3.8% at $55.68.

Dynavox

(DVOX)

, a

maker of communication and education products for people with learning disabilities, was topping the Nasdaq after reporting better-than-expected third quarter earnings late Wednesday. Shares soared 30% to $7.89.

Shares of

Symantec

(SYMC) - Get Report

jumped 5.2% to $20.42 after the company posted better-than-expected results and raised its outlook. Bank of America/Merrill Lynch upgraded the stock to neutral from sell and raised the price target to $22 from $18.

Hong Kong's Hang Seng shed 0.9%, and Japan's Nikkei lost 1.5%. The FTSE in London dropped 0.5%, and the DAX in Frankfurt declined by 0.7%.

The benchmark 10-year Treasury fell 8/32, lifting the yield to 3.226%.

.

--Written by Melinda Peer and Shanthi Bharatwaj in New York

.

Disclosure: TheStreet's editorial policy prohibits staff editors and reporters from holding positions in any individual stocks.