U.S. oil prices surged 5.18 percent on Wednesday after the U.S. government reported a surprise draw in domestic crude stockpiles.

Crude stocks fell 4.9 million barrels last week as refineries continued to hike output and imports dropped, the Energy Information Administration (EIA) reported. Analysts polled by Reuters had expected inventories to hit record highs for an eighth straight week with a build of 3.2 million barrels. U.S. crude futures settled at $37.75 a barrel, up $1.86, or 5.18 percent. International Brent futures rose $1.91 to $39.76 a barrel.

U.S. crude futures found additional support from TransCanada Corp's delayed restart of its 590,000 barrel per day Keystone pipeline that delivers crude to Cushing and Illinois.

U.S. futures' front-month was at its narrowest discount in three weeks to the second month following the outage. Brent was also underpinned by planned maintenance works at Norway's Ekofisk and Britain's Buzzard oil fields. The rally represented a sentiment shift in oil after last week's 7 percent drop in U.S. crude futures and 4 percent in Brent amid worries the global glut in oil was growing again while producing countries' plans to freeze output would fail. The EIA also reported that gasoline stocks rose for the first time in six weeks, potentially snapping a pillar of support to U.S. crude prices. Stockpiles at the Cushing, Oklahoma, delivery hub for U.S. crude futures, another key data point, also rose. But traders chose to focus on more bullish aspects of the inventory report like the crude draw and the drop in crude imports of nearly 450,000 bpd. "I think the market is more about the total change in (crude) inventories, rather than individual components," said Scott Shelton, energy broker with ICAP in Durham, North Carolina. "It's the first week of the second quarter and we have a net draw. That will force the bears to rethink their bearish balances for Q2." Refinery runs rose by almost 200,000 bpd as utilization rates rose 1 percentage point.