NEW YORK (

TheStreet

) -- Stocks closed higher Wednesday after a late surge, after spending much of the day pressured by declining commodities prices and energy sector stocks.

The

Dow Jones Industrial Average

finished the day up 51 points, or 0.5%, to 10,337. The

S&P 500

added 4 points, or 0.4%, at 1096 and the

Nasdaq

gained 11 points, or 0.5%, at 2184.

3M

(MMM) - Get Report

shares rebounded from Tuesday's selloff and led advancers on the Dow, after analysts from Citigroup upgraded the stock to buy from hold. Shares traded higher by 3.4% to $79.74 at the closing bell.

> > The Top Energy Stocks for 2010

Prices on the January crude oil contract fell $1.95 to settle at $70.67 a barrel after trading around $73 after the the Energy Information Administration said

crude inventories

fell by 3.8 million barrels. The draw down was better than the 600,000-barrel build in crude oil inventories that analysts polled by Platts anticipated. But an unexpected rise in gasoline and distillate stockpiles helped whipsaw and ultimately drive futures lower Wednesday.

But oil-related shares pared losses late after spending much of the day mired in the red.

Chevron

(CVX) - Get Report

added 0.4%, while

Exxon Mobil

(XOM) - Get Report

declined by 0.2%.

The Dollar Index stabilized in the afternoon. The index was recently down by 0.3%. Gold for February delivery shed $22.50 to settle at $1,120.90 an ounce.

TheStreet Recommends

"That nonfarm payroll report

on Friday really put the fear in the dollar-carry trade. You've seen a sharp pullback in gold and commodities," said Michael Pento, senior market strategist with Delta Global Advisors. "Today we're kind of treading water because people seem to think that the Fed is going to be more aggressive and take action sooner than expected."

Pento thinks that sentiment is misguided but said the dollar-carry trade won't get back on track until gold traders regain confidence on dollar weakness.

Treasuries continued dropping in the afternoon after the Treasury Department sold $21 billion in reopened 10-year notes. The auction drew a high yield at 3.448% and bid-to-cover ratio at 2.62. Indirect bidders, which includes foreign central banks, was also down compared to recent averages, accounting for nearly 35% of the notes sold.

Global credit concerns persisted Wednesday as Spain became the latest country to unsettle investors after Standard & Poor's lowered its outlook for the country's credit rating. On Tuesday, credit agencies highlighted weaknesses in Greece and among certain Dubai government-controlled companies.

A 50% windfall tax on U.K. banker bonuses is also driving chatter overseas. Alistair Darling, the British Finance Minister, announced the levy on bonus pools Wednesday. The tax is to be paid by the banks rather than individual payments, and impact bonus amounts above $40,800.

Before the closing bell,

CNBC

reported that

Citigroup

(C) - Get Report

may announce plans to sell stock by week's end in preparation for repayment of funds under the Troubled Asset Relief Program.

Bank of America

(BAC) - Get Report

already announced its plan to pay back the government, putting pressure on other banks such as Citigroup and

Wells Fargo

(WFC) - Get Report

that have yet to develop

TARP exit strategies. Shares of BofA, Citigroup and Wells Fargo fell nominally.

Earlier, the Obama administration extended the $700 billion

bailout program through next October. President Barack Obama earlier on Wednesday vowed to wind down the TARP and focus on lowering the deficit.

In economic news, the Commerce Department said wholesale inventories unexpectedly rose in October, increasing 0.3%, compared with the decline of 0.5% that economists had expected. The increase -- a first in more than a year -- compares to a dip of 0.8% in September, which was revised from a previously-reported drop of 0.9%.

The Mortgage Bankers Association said mortgage loan application volume rose 8.5% on a seasonally adjusted basis from last week.

The Consumer Comfort Index fell last week, down by 47, compared with the previous week, which was down by 45.

--Written by Melinda Peer and Sung Moss in New York

.