Oil prices rose on Friday towards $45 a barrel, heading for a third straight week of gains as market sentiment turned more upbeat despite persistent oversupply.
Strong gasoline consumption in the United States and increasing signs of declining production around the world as well as oilfield outages have underpinned a return to investment in the sector, traders said.
But analysts warned that the oil market is still far from balancing supply and demand.
"While this recent rally has the potential to run further to the upside ... we believe that it is not yet driven by a sustainable shift in fundamentals," Goldman Sachs said in a note to clients.
International benchmark Brent crude futures were trading at $44.68 per barrel at 1222 GMT, up 15 cents, or 0.35 percent, from their last settlement.
U.S. West Texas Intermediate (WTI) crude was up 22 cents, or 0.5 percent, at $43.40 a barrel.
Brent has risen about 3.7 percent so far this week and WTI 7.6 percent as both benchmarks headed for a third consecutive week of gains. Crude is up more than two-thirds since its 2016 lows between January and February.
Goldman said it was "premature to embrace these green shoots", maintaining its view that a sustainable balancing of the market, driven by declines in U.S. shale oil production, would take place in the third quarter of 2016.
But the Wall Street bank changed its view on energy to "neutral" from "underweight", citing a reduced likelihood of extreme downside.
Another supportive factor has been producers taking advantage of higher prices by locking in output.
"We would expect producers in the U.S. taking every opportunity to aggressively hedge as soon as there is opportunity when oil prices recover for short periods of time," French investment bank Natixis said.
Falling output, especially in the United States, where many producers are shutting down following an up to 70 percent price rout since 2014, is also helping to lift the market.
Natixis said it expected U.S. oil production to drop by at least 500,000 to 600,000 barrels per day (bpd) this year, compared with 2015, and by another 500,000 bpd in 2017.
Despite the recent rally, oil markets remain oversupplied as between 1 and 2 million barrels of crude are being pumped out of the ground every day in excess of demand, leaving storage tanks around the world filled to the brim with unsold fuel.
(Additional reporting by Henning Gloystein in Singapore; Editing by Dale Hudson)