NEW YORK (MarketWatch) -- Crude-oil futures rallied nearly $3 to a record closing level of $102.59 a barrel Thursday, as investors' voracious appetite for oil shows no sign of abating.

Oil prices got a boost from the dollar's tumble to record lows against some of its major counterparts.

Crude oil for April delivery gained $2.95 to end at $102.59 a barrel on the New York Mercantile Exchange. This is a record closing level for a front-month contract.

In after-hours, electronic trade, the crude contract continued to surge, hitting an all-time high of $102.77 a barrel.

"The dollar's entrenched downtrend [is] attracting more speculative buyers to the crude oil market," said Michael Fitzpatrick, an analyst at MF Global, a futures brokerage, in a research note.

"Aggressive buying behavior by investors into commodity markets, including energies, will probably not be shelved anytime soon, especially since inflation fears have been stirred up again, as investors continue to seek diversification," Fitzpatrick said.

Oil surged on the back of weakness in the U.S. dollar, which tumbled to fresh record lows against the euro and the Swiss franc after lackluster economic data and Federal Reserve Chairman Ben Bernanke's comments raised fears about the U.S. economy. See The Fed.

The trade-weighted dollar index, which measures the greenback against a basket of six major currencies, fell 1.2% to 73.68. See Currencies.

Thursday's economic news was downbeat. The Commerce Department reported Thursday that the U.S. economy grew at an unrevised 0.6% annual rate for the fourth quarter. See Economic Report.

Also Thursday, the Labor Department reported that first-time claims for state unemployment benefits rose 19,000 last week, reaching the highest level since late January. Read more.

A weaker greenback tends to push up prices for dollar-denominated commodities, such as oil, because those commodities become less expensive for buyers holding other currencies.

"There aren't any fundamentals justifying this price," said James Williams, energy economist at WRTG Economics, who expects oil to retreat eventually. "We have no examples of a recession in the last 30 years that was not followed by a drop in crude-oil prices."

"What I see is a market that's just trading on emotions, and I think it's about to collapse," Williams said.

On March 5, when members of the Organization of Petroleum Exporting Countries meet, "they're not going to cut production with prices above $100 a barrel," he said.

Earlier Thursday, oil prices were supported by reports of a partial shutdown of production in Nigeria, Africa's largest oil producer and the U.S.'s fifth-largest crude supplier.

Crude-oil production from Eni SpA's E, -2.26% Brass River terminal was cut by around 50,000 barrels a day as a result of an attack by a militia group, Dow Jones Newswires reported on Thursday, citing West African traders.

On Wednesday, crude closed below $100 a barrel after surging to a high of $102.08, coming under pressure after data showed the nation's crude inventories grew by more than expected in the week ended Feb. 22.

Natural gas surges

Natural-gas futures rose sharply after data showed U.S. inventories fell for a 14th week. April natural-gas futures rallied 38 cents to end at $9.44 per million British thermal units.

U.S. natural-gas inventories fell 151 billion cubic feet in the week ended Feb. 22, the Energy Department reported on Thursday. Inventories have been falling since mid-November and have dropped nearly 2,000 billion cubic feet.

At 1,619 billion cubic feet, U.S. natural gas stockpiles were 133 billion cubic feet less than last year at this time, the Energy Department said. After the data, natural gas surged to its highest level since February 2006.

Rounding out the early action in energy, March reformulated gasoline gained 2 cents to $2.50 a gallon and March heating oil rose 8 cents to end at $2.85 a gallon. Both contracts are due to expire on Friday.

Gold futures ended with strong gains, surging to a record high of $975 an ounce in after-hours trading, propelled by the dollar's tumble to a new low against the euro. See Metals Stocks.

In other commodity news, futures and options broker MF Global MF, -0.92% said Thursday that it would take a $141.5 million bad debt provision after one of its Memphis brokers, identified as Evan Dooley, vastly exceeded his authorized trading limit Wednesday morning. He was trading wheat futures in Chicago. Shares in MF Global dropped as much as 23%. See full story.

Commodities traders said actions by the brokerage to cover Dooley's large short position appeared to cause a violent jump in wheat prices in Chicago Wednesday. Read more about wheat futures. Read more.