Crude oil prices climbed more than $1 to close near the $51 mark after U.S. crude inventories fell 1.6 million barrels, the second drop in 15 weeks.

Light, sweet crude for July delivery rose $1.31 to $50.98 a barrel on the New York Mercantile Exchange (search), after hitting $51.60 earlier in the day. Heating oil prices rose more than 4 cents to $1.4284 a gallon, while unleaded gasoline rose more than 2 cents to $1.4517 a gallon.

The Energy Information Administration's (search) midweek petroleum data showed U.S. commercial crude oil inventories fell 1.6 million barrels to 332.4 million barrels in the week ending May 20 from the previous week. It is just the second decline in 15 weeks. Still, inventories are 31.8 million barrels higher than year-ago levels.

Analysts had anticipated another rise in crude.

"The market was so accustomed to see builds in crude stocks, so they were shocked to see a drop," said Phil Flynn, analyst at Alaron Trading Corp. in Chicago. "That's why you see this buying kick in."

Meanwhile, U.S. gasoline inventories rose 600,000 barrels to 215.4 million barrels, up from 203.6 million a year ago. Most analysts had predicted a decline in gasoline stocks.

Distillates rose 1.9 million barrels to 105.7 million, up from 104.7 million last year but still in the lower half of the average range for this time of year. High sulfur distillates, or heating oil, comprised most of that increase, rising 1.6 million barrels to 39.7 million barrels, up from 35.9 million a year ago.

Crude prices are about $7 lower than their all-time high of $58.28 set April 4.

After several weeks of market bearishness, this decline in crude could signal the end of this season's crude builds, said Michael Guido, director of commodity strategy in New York for bank Societe Generale.

"It sets the tone for a seasonal draw period in crude — the market is trading off that as well," Guido said.

Wednesday's rally in crude futures was also helped by U.S. durable goods and housing figures, Flynn said.

Orders to U.S. factories for big-ticket manufactured goods shot up 1.9 percent last month, and sales of new homes hit an all-time high. These are signs of a strengthening economy, which means demand for oil will likely rise.

Economist Andy Xie of Morgan Stanley Asia in Hong Kong said there is a common perception among traders now that there is some "tightness in refinery capacity."

"There hasn't been a lot of investments in this sector, and if it's not rectified, the bullish sentiment among traders will remain powerful," Xie said.

Noises from key OPECnations about possibly reducing production also put some upward pressure on prices. Joining such suggestions from Venezuela, Iranian Oil Minister Bijan Zanganeh said Wednesday that the option of cutting output is "something that needs to be discussed."

Tanker-tracker Petrologistics said this week that the 11 members of the Organization of Petroleum Exporting Countries (search) boosted output an estimated 430,000 barrels a day to 30.05 million barrels a day.

Such high OPEC output has kept markets relatively calm, but Western concerns remain about too much dependence on the group. The inauguration Wednesday of the first section of an 1,100-mile U.S.-backed pipeline bringing Caspian Sea oil to Western markets was meant to reduce such worries.

Kenney said that once fully operational the pipeline will represent a "significant" addition to Western oil supplies, although the time needed to fill it means "you won't see exports until the later part of the year."

Crude prices climbed Tuesday, after rumors of a shutdown at Exxon Mobil Corp.'s Baytown refinery in Texas. Benchmark commodity settled 51 cents higher at $49.67 per barrel on Tuesday after rising as high as $49.94 per barrel. However, on Wednesday, Treacy A. Roberts, senior advisor of ExxonMobil Baytown Area Public Affairs, said that "the Baytown Refinery is operating normally."