U.S. oil erased gains Wednesday as the dollar jumped following the release of Federal Reserve meeting minutes that showed policymakers could raise interest rates in June.
A stronger greenback makes dollar-denominated commodities more expensive to holders of other currencies.
U.S. West Texas Intermediate crude futures settled 12 cents lower, at $48.19 a barrel. The session high was $48.95, its highest since mid-October.
International Brent crude was down 46 cents at $48.80 a barrel. It reached $49.85 earlier, its highest since November.
Oil prices had risen about 1 percent on Wednesday, hitting new 2016 highs, as the market focused on large drawdowns in U.S. refined fuel inventories and ignored a surprise build in crude stockpiles.
Brent and U.S. crude's West Texas Intermediate (WTI) futures advanced closer to the $50 a barrel target after the mixed supply-demand data from the U.S. Energy Information Administration (EIA).
U.S. crude inventories rose 1.3 million barrels in the week to May 13, compared with analysts' expectations for a decrease of 2.8 million barrels and a 1.1 million-barrel drawdown reported on Tuesday by a trade group, the American Petroleum Institute.
Crude stocks at the Cushing, Oklahoma, delivery hub for WTI futures also rose, by 461,000 barrels, to record highs.
The market's attention, however, was on a gasoline stockpile drop of 2.5 million barrels after analysts had expected a decline of 150,000 barrels.
Distillate stockpiles, which include diesel and heating oil, slumped by 3.2 million barrels, versus expectations for a 642,000-barrel drop.
"Overall, the strength in refined products and the seasonality heading into the peak U.S. driving season should give a bullish bias to today's data points," said Chris Jarvis, analyst at Caprock Risk Management in Frederick, Maryland.
Oil has rallied since the start of this week on expectations of lower U.S. crude stockpiles, a new wildfire threat on Canadian oil supplies and worries about outages in Libya and Nigeria.
Prices are up more than 80 percent from 12-year lows of around $27 for Brent in January and about $26 for WTI in February.
Even so, analysts worry about another major oil glut.
"People are cautious and still wonder about the Q4 2016/H1 2017 balance," said analysts at Vienna-based JBC Energy, who forecast a current oversupply of 800,000 bpd.
Data from Iran showed its oil exports were also recovering faster than expected. Iran, the world's fourth largest oil producer and number two exporter in the Organization of the Petroleum Exporting Countries, is set to ship 2.1 million bpd in May, nearly 60 percent above their level a year ago.
Saudi Arabia's crude oil exports in March, however, fell slightly to 7.541 million bpd from 7.553 million in February, official data showed on Wednesday.
JBC also warned that a rise in oil prices towards $50 per barrel could reverse some production declines among high-cost producers, including shale drillers in the United States.
— CNBC's Tom DiChristopher contributed to this report.