Oil futures ended slightly higher Wednesday in volatile trading after a government report showed a steep drop in U.S. oil inventories last week.

Light, sweet crude for August delivery settled up 64 cents, or 0.7%, at $98.14 a barrel on the New York Mercantile Exchange. With the front-month contract expiring at the close of trading, the more actively traded September contract settled up 54 cents, or 0.6%, to $98.40 a barrel.

Brent crude on the ICE futures exchange settled up $1.09, or 0.9%, at $118.15 a barrel.

Futures ended higher after the after the Department of Energy said U.S. oil stockpiles fell 3.7 million barrels last week. The decline was bigger than expected, though it was offset somewhat by increases in inventories of refined products.

"It's kind of a mixed bag," said Jason Schenker, president of Prestige Economics, a consultancy based in Austin.

Traders look to the government's weekly inventory report for clues on U.S. supply and demand levels. Although a drop in crude stockpiles typically lifts prices because it signals strong demand from refiners, an opposite change in product inventories can blunt the market's response.

Gasoline inventories rose 800,000 barrels last week, the DOE said. Stocks of distillates, including heating oil and diesel, jumped 3.4 million barrels.

In a sign of brisk demand for refined products, refinery utilization rose 2.3 percentage points to 90.3% of capacity, their highest rate of utilization in almost a year. Analysts expected utilization to rise just 0.2 percentage point.

The figure "was surprising to everybody," said Mark Waggoner, president of brokerage Excel Futures.

Inventory levels at the U.S. Strategic Petroleum Reserve were unchanged, the DOE said. The U.S. will be releasing about 30 million barrels of oil from strategic stocks as part of a global release of twice that amount. Some of those barrels are expected to hit the market later this month.

Oil futures traded in a wide range Wednesday, surging to as high as $99.02 a barrel ahead of the DOE report. Crude remained in positive territory most of the day, but briefly turned lower, falling as low as $96.64 before reversing suddenly course to finish the day higher.

Some market participants attributed the sudden pullback to profit-taking after their run higher earlier in the day. But the retreat left others uncertain.

"It's very weird," said Andy Lebow, a vice president at brokerage MF Global in New York. "The market is really lacking conviction."

Nymex crude futures have held to a tight range between $92 and $100 a barrel over the last three weeks, with uncertainty over the U.S. recovery and the European debt crisis keeping traders from placing big bets on higher crude prices.

Strong demand from emerging markets like China, the No. 2 oil consumer, has helped keep a floor under prices, however.

Market participants will get further clarity on Europe's efforts to contain its debt woes when top euro-zone leaders gather Thursday to discuss another bailout for Greece.

Front-month August reformulated gasoline blendstock, or RBOB, settled 3.21 cents, or 1%, to $3.1470 a gallon. August heating oil settled up 2.04 cents, or 0.7%, at $3.1184 a gallon.