Oil prices rose for the fourth straight week on expectations that production will soon plateau and amid uncertainty about Iranian nuclear negotiations.
Light, sweet crude for May delivery settled up 85 cents, or 1.7%, to $51.64 a barrel Friday on the New York Mercantile Exchange. Prices rose 5.1% in the week.
Brent, the global benchmark, rose $1.30, or 2.3%, to $57.87 a barrel on ICE Futures Europe, posting a 5.3% weekly gain.
The moves capped a volatile week of trading, as investors continued to assess the global glut of oil that sent prices plunging in 2014.
The market is currently oversupplied by between one and two million barrels of oil a day, analysts estimate, but many expect production to begin falling this month or later in the quarter as spending cuts begin to take their toll.
Oil-field-services firm Baker Hughes Inc. said Friday that the number of rigs drilling for oil in the U.S. fell by 42 to 760 in the latest week, the largest drop in four weeks. The number of oil-drilling rigs has declined for 18 straight weeks as producers have cut spending on new output because of low oil prices. Most of the decline was in the Eagle Ford and Permian shales, key regions for shale-oil production.
The latest rig-count data "signal that U.S. production is a lot closer to topping," said Phil Flynn, analyst at Price Futures Group in Chicago. "The mood seems to be shifted more toward the bullish side."
The rig count can be an early indicator for output, though producers have also increased the amount of oil they can extract from an individual well and production has continued to rise in recent weeks.
Traders also eyed geopolitical uncertainties, including unrest in the Middle East and a potential final deal over Iran's nuclear program.
In his first public comments after last week's agreement on a framework for a nuclear deal, Iran's supreme leader Ayatollah Ali Khamenei said Thursday that the U.S. and its negotiating partners must lift all sanctions on his country immediately after a final deal is signed.
The West has been demanding a phased repeal of the penalties, conditional on Iran's continuing compliance.
Oil markets are tracking the negotiations because a deal could pave the way for more Iranian crude flooding the already oversupplied global market. Analysts estimate that if sanctions are lifted, Iran could add between 500,000 and 1 million barrels a day to the global market.
"The U.S.A. and [European Union] are unlikely to accede to Khamenei's demand," said Commerzbank in a note. "It once more seems doubtful whether a final settlement of the nuclear dispute will be reached by midyear, making a lifting of the sanctions before year-end questionable."
Gasoline futures settled up 4.81 cents, or 2.7%, to $1.8073 a gallon. Prices rose 2.6% in the week.
Diesel futures rose 3.93 cents, or 2.3%, to $1.7661 a gallon, posting a 5% weekly gain.
(By Nicole Friedman; Georgi Kantchev contributed to this article,)