Oil prices rose about 2 percent on Wednesday as U.S. crude inventories rose less than expected, supply disruptions continued in Libya and the OPEC-led output cut by producing countries looked likely to be extended.
U.S. crude futures surged to nearly a two-week high after the Energy Information Administration (EIA) reported that crude inventories rose 867,000 barrels last week, nearly half the build expected, as refineries ramped up processing after seasonal maintenance and imports dropped and exports rose.
West Texas Intermediate (WTI) crude futures futures settled $1.14 higher at $49.51, rising 2.4 percent on the day for the best close in three weeks.
Brent crude futures rose 95 cents, or 1.9 percent, to $52.28 a barrel by 2:38 p.m. EDT (1838 GMT) after hitting the highest level since March 16.
U.S. gasoline futures surged more than 2 percent to the highest in three weeks after EIA data showed a 3.7 million-barrel drop in gasoline stocks last week, nearly 2 million barrels more than forecast.