Updated from 4:14 p.m. EDT

Stocks in New York overcame early sluggishness and closed higher Thursday as strength in energy shares, homebuilders, chip names and retailers gave the market a lift.

After falling as much as 56 points earlier, the

Dow Jones Industrial Average

turned things around and finished ahead by 68.34 points, or 0.55%, at 12,552.96. The

S&P 500

added 8.93 points, or 0.62%, to 1447.80, and the

Nasdaq

gained 21.01 points, or 0.85%, to 2480.32.

Providing support for the rebound was a 1.8% jump in the Philadelphia Stock Exchange Housing Sector Index and a 1.6% climb in the Amex Oil Index. Elsewhere, the Philadelphia Semiconductor added 1% and the S&P Retail Index tacked on 0.5%.

Before the surge, the market opened weak as the fallout from the

Federal Reserve's

latest pronouncements on the economy put pressure on Wall Street. On Wednesday, the minutes from the March meeting of the Fed suggested policymakers are having a tough time determining whether they should worry more about an economic slowdown or inflation.

Importantly, the central bank indicated that it hasn't completely ruled out additional rate increases. Stocks closed the day to the downside.

"People may have had an overreaction to the Fed minutes yesterday," said Robert Pavlik, chief investment officer with Oaktree Asset Management. "The market still seems to have some legs behind it. We gained back what we lost yesterday, and that we've been able to hold up is a net positive. Today's optimism will hopefully have some positive impact for tomorrow."

About 2.84 billion shares changed hands on the

New York Stock Exchange

, and volume on the Nasdaq reached 1.98 billion shares. Winners outpaced decliners 2 to 1.

Headlining the new day in the U.S. were the nation's retailers, which were posting their monthly results. The biggest,

Wal-Mart

(WMT) - Get Report

, said comp sales rose 4% in March. Analysts had expected Wal-Mart to post a 1.6% rise.

However, the company said that meeting first-quarter guidance will be a challenge. Wal-Mart dipped by a penny to close at $47.26.

During the previous session, rival

Target

(TGT) - Get Report

beat expectations after posting a 12% increase in same-store sales last month. On Thursday, Target gained 27 cents, or 0.5%, to finish at $59.95.

Among other retailers,

Limited's

(LTD)

comps were up 8% last month, and

Gap

(GPS) - Get Report

posted a 6% increase. Shares of Limited slid 2.9% to $26.32. Gap finished fractionally lower at $18.61.

Both

Costco

(COST) - Get Report

and

Pacific Sunwear

(PSUN)

reported strong same-store sales growth, and

J.C. Penney

(JCP) - Get Report

easily beat the forecast. Costco rose 1.2% to $54.68, and J.C. Penney gained 0.4% to finish at $83.75.

Sharper Image

( SHRP) was one of the few losers. The company said its March comparable sales slid a wider-than-expected 29%. However, the stock was still higher by 1.2% at $11.55.

Among ratings changes, both HSBC Securities and Citigroup upgraded

Lam Research

(LRCX) - Get Report

. UBS raised

Kraft Foods

( KFT) to buy from neutral. Lam Research was up 1.5% to close at $50.98, and Kraft gained 1.3% to $32.45.

Following the previous session,

Research In Motion

( RIMM) posted fiscal fourth-quarter results that matched estimates, but quarterly revenue came in below Wall Street's target. Even worse was news that regulators have stepped up a probe of the company. RIM dropped $11.92, or 8.2%, to end the session at $134.10.

Genentech

( DNA) reported a 43% rise in first-quarter results compared to the year-ago period, and adjusted earnings of 74 cents a share topped the Thomson First Call consensus. Still, shares were off $1.06, or 1.3%, to $81.63.

Meanwhile, investors had to face the first busy day of the week on the economic front. The Labor Department said its import price index rose 1.7% in March, nearly tripling expectations. Excluding petroleum, import prices added 0.2%.

Separately, Labor said initial jobless claims jumped 19,000 to 342,000 last week. The less-volatile four-week moving average increased by 7,000 claims, to 323,250.

Treasuries were little changed, with the 10-year note down 1/32, yielding 4.74%, and the 30-year bond lower by 1/32, yielding 4.91%. In the currency market, the euro hit a two-year high against the dollar owing to expectations that rates will rise in Europe.

Commodities ended mixed following a volatile trading session. Oil jumped $1.84 to finish at $63.85 a barrel, but gold eased $2 to $679.70 an ounce.

Overseas, stocks were generally softer. Tokyo's Nikkei shed 0.7% to 17,540, and Hong Kong's Hang Seng lost 0.3% at 20,380. London's FTSE was up 0.05% to 6416, and Frankfurt's Xetra DAX was lower by 0.1% at 7143.

Investors will close out the week Friday with earnings reports from

General Electric

(GE) - Get Report

and

Infosys Technologies

(INFY) - Get Report

. Traders will also be reviewing the latest readings of the producer price index and the U.S. trade balance.