OPEC clinched a deal to curtail oil supply, confounding skeptics as the need to clear a record global crude glut — and prove the group’s credibility — brought its first cuts in eight years. Crude rose as much as 8.8 percent in London.

OPEC will reduce output to 32.5 million barrels a day, Iranian Oil Minister Bijan Namdar Zanganeh told reporters in Vienna after a ministerial meeting Wednesday. The breakthrough deal, effective in January, showed an acceptance by Saudi Arabia that Iran, as a special case, can still raise production.

The Organization of Petroleum Exporting Countries is ditching a pump-at-will policy introduced in 2014 to resume its traditional role as price fixer. The shift, aimed at draining a crude glut that’s pushed down prices for two years, is intended to help revive the tattered finances of oil-producing countries and will reverberate in markets around the world, from the Canadian dollar to Nigerian bonds to U.S. shale equities.

“This should be a wake-up call for skeptics who have argued the death of OPEC,” said Amrita Sen, chief oil analyst at Energy Aspects. “The group wants to push inventories down.”

After weeks of often tense negotiations, the eventual alignment of OPEC’s biggest producers points to the increasing dominance of Iran among the group’s top ranks. It’s allowed to raise output to about 3.8 million barrels a day, a victory for a country that’s long sought special treatment as it recovers from sanctions.

Saudi Arabia previously proposed that its regional rival limit output to 3,707,000 barrels a day, delegates said.

The agreement, which also calls for a reduction of about 600,000 barrels a day by non-OPEC countries, pushed up Brent crude by as much as $4.08 to $50.46 a barrel. Still, prices remain at half their level of mid-2014.

The economics of the deal are “incredibly appealing,” Jeff Currie, global head of commodities research at Goldman Sachs, said in an interview with Bloomberg Television. The main aim of the cuts is “inventory normalization,” he said.

Saudi Arabia, which raised oil production to a record this year, will reduce output by 486,000 barrels a day to 10,058,000 a day, an OPEC document shows. Iraq, OPEC’s second-largest producer, agreed to cut by 210,000 barrels a day from October levels. The country had previously pushed for special consideration, citing the urgency of its offensive against the Islamic State.

The United Arab Emirates and Kuwait will reduce output by 139,000 barrels a day and 131,000 a day respectively, the document shows. Nonmember Russia, also pumping at a post-Soviet record, will cut by as much as 300,000 barrels a day, “conditional on its technical abilities,” Energy Minister Alexander Novak said in Moscow.

Russia, the biggest producer outside the bloc, had previously resisted calls to trim its production, insisting that it would only consider a freeze. OPEC plans to hold talks with non-OPEC producers next week in Doha, Qatar.

“What was announced so far is bullish, but January is still far away,” said Giovanni Staunovo, an analyst at UBS Group.

The strength of the deal will depend on whether all parties deliver on their commitment. Saudi Arabia and its Persian Gulf allies, the U.A.E. and Kuwait, have traditionally stuck to their cuts, but some others haven’t, particularly when prices are low. Any doubt in the market could once again see prices come under pressure.

The past two years have been painful for OPEC. The group will earn $341 billion from oil exports this year, according to the U.S. Energy Information Administration. That’s down from $753 billion in 2014 before prices crashed, and a record $920 billion in 2012.

The group will meet again on May 25 next year, at which point it intends to extend the cuts by another six months, Qatari Energy Minister Mohammed Al Sada told reporters in Vienna.

Indonesia requested a freeze of its OPEC membership. Its suspension won’t affect the size of the group’s production cut, one delegate said.