Oil rallied on Wednesday for the first time in four days after weekly U.S. stock builds turned out to be less than some feared, and negotiators missed a deadline on Iranian nuclear talks that might bring more supply to the market.
U.S. oil futures closed up $2.49, or 5.2 percent, at $50.09 a barrel after government data showed crude inventories in the United States rose 4.8 million barrels to 471.4 million in the week to March 27, hitting record highs for a 12th straight week.
While analysts in a Reuters poll had expected a 4.2-million-barrel build on average last week, some feared a bigger rise after industry group the American Petroleum Institute suggested as much as 5.2 million barrels in a Tuesday report.
Domestic crude production also fell 0.4 percent to 9.4 million barrels per day, the first weekly decline since the end of January.
U.S. gasoline demand has also risen over the past four weeks, up 2 percent from the same period a year ago, government data showed.
"Clearly, there is a (gasoline) demand response underway by consumers to the low retail price," said John Kilduff, partner at New York energy hedge fund Again Capital.