Oil closed higher on Wednesday, recovering some earlier losses, as U.S. stocks recovered and refined products data supported prices.
U.S. crude for October settled up 1.85 percent, at $46.25 a barrel, having traded as low as $43.21 earlier after U.S. government data showed a big rise in U.S. crude stockpiles, adding to concerns about global oversupply and sluggish economic growth in China.
But there were some supportive aspects to the inventory report, especially in terms of gasoline, John Kilduff, partner at Again Capital LLC in New York, said.
"The report is mixed in that it is bearish for crude oil, but somewhat supportive of refined products," he said. "Crude oil imports rebounded markedly and refinery utilization fell again, allowing for the substantial crude oil inventory rise."
U.S. crude oil stocks rose by 4.7 million barrels to 455.4 million barrels last week, the Energy Information Administration (EIA) said.
"While there is some seasonality to crude beginning to build at this time of the year, a four-plus-million-barrel build is bearish and larger than normal," said Scott Shelton, commodities specialist with ICAP in Durham, North Carolina.
Analysts in a Reuters poll had expected U.S. crude stocks to have remained flat last week and the EIA report followed Tuesday's report from American Petroleum Institute (API) showing crude stocks rose 7.6 million barrels to 456.9 million.
Brent crude for October rose $1 to $51 a barrel, after hitting $47.74 earlier.
Crude futures extended losses after the EIA report on news that Shell's Nigerian unit has lifted force majeure on Bonny Light exports following the repair and re-opening of the Trans Niger Pipeline (TNP) and Nembe Creek Trunkline (NCTL).
Also adding pressure was news that President Barack Obama has the backing of enough Senate votes to sustain a veto of any congressional resolution blocking Iran's agreement on its nuclear program with world powers.
Implementing the agreement will allow a sharp increase Iran's oil exports now curbed by sanctions.
Crude oil received some support ahead of the EIA report from strong U.S. RBOB gasoline futures, supported by news that a reformer unit at Philadelphia Energy Solutions' Philadelphia refinery complex was shut on Tuesday due to small fire, although it was being restarted on Wednesday.
EIA data showed gasoline inventories fell 271,000 barrels, much less than the 1.3 million-barrel slide expected by analysts.