U.S. oil prices jumped nearly 5 percent on Wednesday after a huge draw in U.S. gasoline inventories last week convinced the market that energy demand was improving despite U.S. crude stockpiles hitting record highs for a fourth week.
Crude prices also gained support on speculation that top oil producers might agree soon to an output freeze.
U.S. crude futures settled $1.79 higher, or 4.9 percent, at $38.29 a barrel. Brent crude futures rose $1.29 to $40.94 a barrel, having touched three-month highs on Tuesday above $41.
The U.S. Energy Information Administration said crude stockpiles rose 3.9 million barrels to nearly 522 million barrels, as predicted by analysts in a Reuters poll.
But gasoline inventories fell 4.5 million barrels, much more than the polled number of 1.4 million barrels.
"Gasoline is the star of the show today. Ongoing strength in demand has yielded a large draw to gasoline inventories despite a rebound in refinery runs," said Matt Smith, director of commodity research at New York-headquarter energy data provider ClipperData.