U.S. crude for December snapped a three-day losing streak to settle up more than 6 percent, or $2.74, at $45.94 a barrel on Wednesday.
Oil futures recovered after paring gains slightly following the Federal Reserve's announcement that it would leave interest rates near zero.
Prices had risen on Wednesday, extending gains from an earlier rally, after the U.S. reported a crude inventory build that reversed bearish market expectations.
The price spike stalled oil bears' expectations for a longer and deeper price rout after futures hit two-month lows in the previous session on worries about high supplies and weak demand.
Bets that the U.S. Federal Reserve would hold off on a U.S. rate hike had weighed on the dollar, fueling price gains across commodities and adding to the oil rally.
were up $2.14, or 4.5 percent, at $48.95 a barrel at 2:35 p.m. EDT (1835 GMT), having fallen to their lowest since mid-September on Tuesday.
Prices surged within 30 minutes of the start of the official session in New York, jumping more than $1 with many traders citing a big algorithmic trade for the hike.
The U.S. Energy Information Administration (EIA) added to the rally when it reported that crude stockpiles rose 3.4 million barrels last week, matching analysts forecasts in a Reuters poll. But the build was less than the 4.1 million-barrel build posted on Tuesday by industry group the American Petroleum Institute.
"The market was looking for more bearish information and got a neutral report," Scott Shelton, energy broker and commodities specialist with ICAP in Durham, North Carolina.
The EIA also cited an inventory drop of 785,000 barrels at the Cushing, Oklahoma, delivery hub for U.S. crude futures.
Stockpiles of gasoline and distillates, which include diesel, fell more than expected and front-month U.S. gasoline and ultra-low sulfur diesel futures also gained 5 percent ahead of contract expirations on Friday.
"The draw-down in distillates and gasoline inventories bested expectations by a decent amount, helping to color the report bullish," said John Kilduff, partner at Again Capital in New York.
But some remained steadfast that prices would turn lower eventually, saying whatever reported by the EIA was only mildly bullish.
"We were slightly oversold on a technical basis ... so it was not surprising to see the bounce," said Tariq Zahir, trader in crude oil spreads at Tyche Capital Advisors in Laurel Hollow, New York. "I think any rallies should be sold into since we expect to continue seeing builds in the weeks to come."