Fast-growing producer Iraq also agreed to curtail its booming output, while non-OPEC Russia will join output cuts for the first time in 15 years to help the Organization of the Petroleum Exporting Countries prop up oil prices.
"OPEC has proved to the sceptics that it is not dead. The move will speed up market rebalancing and erosion of the global oil glut," said OPEC watcher Amrita Sen from consultancy Energy Aspects.
The cut did not come without a casualty, however. Indonesia, the producer group's only East Asian member, said it would suspend its membership after rejoining only this year as it was not willing to comply with the output cuts sought.
Following news of the deal, the price for Brent crude futures, the international benchmark for oil prices, surged to settle up nearly 9 percent. They eased slightly in early Asian trading on concerns that other producers, especially U.S. shale drillers, could fill any gap.
The agreement came despite huge political hurdles. Iran and Russia are effectively fighting two proxy wars against Saudi Arabia, in Yemen and Syria, and many sceptics had said the countries would struggle to find a compromise.
Saudi Energy Minister Khalid al-Falih said ahead of the meeting that the kingdom was prepared to accept "a big hit" on production to get a deal done.
"I think it is a good day for the oil markets, it is a good day for the industry and ... it should be a good day for the global economy. I think it will be a boost to global economic growth," he told reporters after the decision.
SOME CAUTION ON CUTS
Some observers were more cautious.
"This is an agreement to cap production levels, not export levels," British bank Barclays said in a note. "The outcome is consistent with ... what OPEC production levels were expected to be in 2017, irrespective of the deal reached."
Despite Wednesday's price surge, oil prices are still only at levels last seen in September and October, when plans for a cut were first announced, and are at less than half their levels of mid-2014, when the glut started.
OPEC produces a third of global oil, or around 33.6 million barrels per day, and under the Wednesday deal it would reduce output by around 1.2 million bpd from January 2017.
That would take its output to January 2016 levels, when prices fell to over 10 year lows.
Saudi Arabia will take the lion's share of cuts by reducing output by almost 0.5 million bpd to 10.06 million bpd. Its Gulf OPEC allies - the United Arab Emirates, Kuwait and Qatar - would cut by a total 0.3 million bpd.
Iraq, which had insisted on higher output quotas to fund its fight against Islamic State militants, unexpectedly agreed to reduce production - by 0.2 million bpd.
Iran was allowed to boost production slightly from its October level - a victory for Tehran, which has long argued it needs to regain market share lost under Western sanctions.
WILL OPEC COMPLY?
Falih had long insisted OPEC would limit output only if non-OPEC producers contributed.
OPEC president Qatar said non-OPEC producers had agreed to reduce output by a further 0.6 million bpd, of which Russia would contribute some 0.3 million.
Russia had previously resisted participating and instead pushed production to new records in recent months.
"Russia will gradually cut output in the first half of 2017 by up to 300,000 barrels per day, on a tight schedule as technical capabilities allow," Russian Energy Minister Alexander Novak said from Moscow.
Novak, who spoke an hour after OPEC announced its deal, did not say from which output levels Russia would cut.
Non-OPEC Azerbaijan and Kazakhstan have said they might also cut.
"With the deal agreed to in principle and country level quotas established, focus will now shift to implementation," Goldman Sachs said in a note to clients.
OPEC will hold talks with non-OPEC producers on Dec. 9. The organisation will also have its next meeting on May 25 to monitor the deal and could extend it for six months, Qatar said.
INDONESIA SUSPENDS MEMBERSHIP
Indonesia, the cartel's only Asian member, said it would suspend its membership as it wasn't willing to cut its production as agreed by OPEC.
"The meeting... requested for Indonesia to cut around 5 percent of its production or around 37,000 barrels per day... As a net oil importing country, a cut to production capacity would not benefit Indonesia," the country's Energy and Mineral Resources Ministry said in a statement.
Indonesia has a patchy OPEC membership history. After first joining in 1962, it left in 2009 as dwindling production meant that Southeast Asia's most populous country had become a net importer of crude oil, which is against OPEC's statute for full membership.
Despite this, it re-joined OPEC in early 2016. Indonesia's suspension will not affect OPEC's overall reduction as its share of cuts will be redistributed among other members.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)