The U.S. oil market recorded its biggest weekly gain in a year on Friday, giddy over the prospect of an international oil production freeze after Saudi Arabia's new energy minister hinted OPEC may take action to prop up energy prices.

The market's hope is the Organization of the Petroleum Exporting Countries, meeting next month in Algiers, the Algerian capital, would agree to cap production around current levels, allowing growing global demand to soak up the oil glut that has kept prices low for more than two years.

Higher prices would give the North American oil industry a much-needed boost after more than 170 production and service companies have gone bankrupt and nearly 150,000 U.S. energy workers have lost jobs. But for such a deal to work, each OPEC producer has to sign off on it, and analysts doubt the cartel can come together.

Iran, liberated from a three-year oil-export ban in January, is still working to increase crude production to boost its economy, which has suffered from international sanctions. And if Iran doesn't cooperate, analysts say, it's highly unlikely Saudi Arabia, OPEC's biggest oil producer, will join in the freeze.

"Nothing's going to happen," said Spencer Welch, an oil market analyst at research firm IHS Markit in London. "But for the next month, everyone is going to be talking about Algiers."

U.S. crude prices settled up 30 cents at $48.52 a barrel on Friday. This week's $4.03-per-barrel gain was the largest in a year.

Domestic oil has climbed more than 16 percent over the last seven trading sessions, rising from $41.71 a barrel onAug. 10, the day before Saudi Arabia energy minister Khalid Al-Falih's comments went viral among traders.

But energy analysts have seen this episode before. In April, OPEC and Russia tried to reach a similar deal in Doha, Qatar, but talks fell apart when Saudi Arabia backed out as Iran refused limit its output of crude.

There's still a Saudi-Iran gridlock, which threatens to bring energy prices lower if OPEC fails to reach an accord next month.

Iran, analysts say, has raised production faster than expected after sanctions lifted, but it's getting to the point where it will need the help of international oil companies to keep increasing production. That makes it unlikely will join a freeze agreement.

If Iran did, it would risk muddling its message to foreign investors, who are putting their money into the country with the expectation that production can and will rise, said Jamie Webster, a fellow at Columbia University's Center on Global Energy Policy.

But by capping production, Iran could signal that it's more difficult to raise output than officials are letting on.

Given the industry's struggles, Webster said, oil companies must choose investments carefully.

"For Iran to rise to the top of the heap when there's a lot of question marks around, that makes it difficult," he said.

But even if the world's largest oil producers agreed to give it a rest, they'd be freezing output near record levels. As a whole, the group put out 33.1 million barrels of oil a day in July, up more than 1 million barrels a day compared with last year, according to independent sources.

The fundamental oil supply-and-demand picture hasn't changed much in the past week; demand is growing, but not fast enough to make significant dents in global stockpiles of crude and gasoline while absorbing increased output.

This year, Iran has pushed production up by 600,000 barrels a day, and it says it won't stop until it brings another 400,000 barrels a day to global markets.

Saudi Arabia produced 10.5 million barrels a day last month, closing in on record levels.

The two rivals, though, seem to have hit plateaus.

If it keeps raising production, Saudi Arabia may find it has stretched its reservoirs to the point of damaging its fields. For Iran, it will probably take a while before it can find the investments needed to kick up production, said Chris Ross, a finance professor at the University of Houston.

But as the oil bust wears on, Saudi Arabia may eventually capitulate, to shore up its government's budget, which depends heavily on oil revenues.

"They may be hitting a practical ceiling," Ross said.

"Generally, that's when they reach an agreement: when they don't have a choice."