Oil prices jumped on Friday and posted a third week of gains as market sentiment turned more upbeat amid signs a global supply glut may be easing.
International benchmark Brent crude futures rose 59 cents to $45.12 per barrel, off a session peak of $45.90. U.S. West Texas Intermediate (WTI) crude settled 55 cents higher, or 1.3 percent, at $43.73, after rising as high as $44.45.
Brent gained about 5 percent this week and WTI nearly 9 percent. Crude is up more than two-thirds since its 2016 lows between January and February.
Strong gasoline consumption in the United States, increasing signs of declining production around the world, and oilfield outages have underpinned a return to investment in the sector, traders said.
"The current rally is driven by a market sentiment that is becoming more and more convinced that the worst is over and the global oil market rebalancing process is already in play," said Dominick Chirichella, senior partner at the Energy Management Institute in New York.
The number of rigs drilling for oil in U.S. fields declined for a fifth straight week, falling by 8 to a total of 382, Baker Hughes reported on Friday. At this point last year, upstream energy companies were operating 703 oil rigs.
Traders also pointed to strong crude imports to China in March as providing support to prices.
Still, some analysts warned that the oil market was 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.
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 production.
French investment bank Natixis said they expect producers in the U.S. to take every opportunity to aggressively hedge as soon as oil prices recover for short periods of time.
Falling output, especially in the United States, where many producers have reeled from an up to 70 percent oil price rout since 2014, has also helped 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.
— CNBC's Tom DiChristopher contributed to this story.