US crude inventories fell 7.6 million barrels last week, its biggest weekly plunge in 10 months, the US Energy Information Administration (EIA) said.
That was much more than the 2.9 million-barrel crude draw forecast in a Reuters poll but was slightly less than the 8.1 million-barrel decline reported by the American Petroleum Institute (API) on Tuesday.
But at 495.4 million barrels, US crude oil inventories were in the upper half of the average range for this time of year.
US gasoline stocks fell 1.6 million barrels, compared with analysts' expectations for a 1.1 million-barrel gain, but were in the upper half of the average range, the EIA said.
"US gasoline demand remains lacklustre and gasoline stocks are still above the five-year average, which will cap gains in crude and gasoline prices," said Abhishek Kumar, Senior Energy Analyst at Interfax Energy's Global Gas Analytics in London.
Brent crude futures were up 44 cents, or 0.9 percent, at $47.96 a barrel by 12:33 p.m. EDT (1633 GMT), while US West Texas Intermediate (WTI) crude was up 63 cents, or 1.4 percent, at $45.67 per barrel.
That bigger gain in US crude, pressured the premium of front-month Brent futures over WTI to $2.12 per barrel, the lowest so far this month.
Before EIA released the storage report, Brent was up 1.9 percent and WTI was up 2.4 percent.
Traders noted suggestions from the Organization of the Petroleum Exporting Countries (OPEC) that the oil market will see a surplus next year also weighed on Wednesday's price gains.
OPEC said its oil production jumped in June and forecast world demand for its crude will decline next year as rivals pump more, pointing to a market surplus in 2018 despite an OPEC-led output cut.
The cartel said the world will need 32.20 million barrels per day (bpd) of crude from its members next year, down 60,000 bpd from this year.
The OPEC-led production cuts, in place since the start of the year, have lent prices some support, but in recent weeks rising output from Libya and Nigeria - OPEC members exempt from the output reduction deal - has pushed supply higher.
"We remain very optimistic ... (about) helping the market to rebalance itself," OPEC Secretary-General Mohammad Barkindo said at an industry conference in Istanbul.
A Saudi industry source said that Riyadh planned to reduce shipments in August by more than 600,000 bpd, taking exports for that month to their lowest this year.