Both contracts gained over 4% earlier in the session.
US crude inventories fell by 7.4 million barrels in the week to July 31 to 518.6 million barrels, the Energy Information Administration said. That exceeded the draw of 3 million barrels analysts predicted in a Reuters poll.
A weaker dollar, which makes oil cheaper for holders of foreign currencies, also supported prices.
“There’s no escaping the benefits of a weaker dollar in the commodity space and oil is certainly basking in its decline,” senior OANDA analyst Craig Erlam said.
Oil also drew support from signs that talks between Democrats in Congress and the White House on a new coronavirus relief package are making progress, although the sides remain far apart.
US factory data this week also showed an improvement in orders, which some analysts took as a hint of economic recovery.
Euro zone business activity returned to modest growth in July as some curbs imposed to stop the spread of the coronavirus eased, the Composite Purchasing Managers’ Index from IHS Markit showed on Wednesday.
Rising prices come against the backdrop of a surge in coronavirus cases which could threaten a recovery in fuel demand.
“As we approach the end of the driving season and enter into the fall heating oil season, refining margins are going to remain under pressure as gasoline and distillate inventories remain substantially above last year and we have been unable to cut into that overhang in a meaningful way,” said Andrew Lipow, president of Lipow Oil Associates in Houston.
Global coronavirus deaths surpassed 700,000 on Wednesday, according to a Reuters tally, with the United States, Brazil, India and Mexico leading the rise in fatalities.
“We see gasoline demand coming in close to 7% year-on-year lower through Q3, with gasoil/diesel registering a decline of some 4%, implying a continued slowdown of the recovery, with a global return to 2019 levels this year increasingly in doubt,” JBC Energy said.
The consultancy sees jet fuel demand down 50% year on year through the third quarter.