But there are doubts about whether it will last because mutual suspicions remain deep and the Sunni-ruled Gulf kingdoms are loath to cede market share to Shiite Iran as it emerges from years of sanctions.
The determination of Saudi Arabia, the world's top oil exporter and de facto leader of the OPEC oil cartel, to protect its market share has contributed to a slump in oil prices to 13-year lows.
However, in the first sign of OPEC and non-cartel producers working together since the rout began, Saudi Arabia and Russia said Tuesday they would freeze output -- if other major producers do the same.
The move may be a signal from Riyadh that the fall in oil prices has gone too far, said Jason Tuvey, an analyst at research firm Capital Economics.
"They are obviously feeling the pain, particularly with a fiscal squeeze now well under way," Tuvey told AFP.
Qatar, Venezuela and Kuwait also agreed to the output freeze. Iraq, OPEC's second-largest producer, said it was prepared to cooperate while the UAE gave its backing.
Iran, which is returning to world markets as sanctions are lifted under a nuclear deal, said after talks in Tehran that it too supported the move, but stopped short of committing itself to any production curbs.
Even so, the rare show of cooperation between the Middle East's foremost Sunni and Shiite powers, which back opposing sides in Syria and other conflicts, sent oil prices soaring on world markets.
Russia, like Iran, is backing Syrian President Bashar al-Assad against rebels supported by Saudi Arabia.
But political and military rivalries will not kill the output deal since both sides need money, said oil expert Jean-Francois Seznec of Georgetown University.
They "can cut production, increase income and still fight each other," he said. "A valid (oil) deal would make it easier to talk about a settlement in Syria."
DEEPENING ECONOMIC WOES
Saudi Arabia, which is also leading a costly military campaign against Iran-backed rebels in Yemen, posted a record $98 billion budget deficit last year.
Riyadh expects a deficit of $87 billion in 2016, forcing it to introduce a series of austerity measures including cuts to subsidies on fuels, electricity and others.
Signup to our newsletter and follow us on Facebook and Twitter!
The International Monetary Fund has cut its forecast for Saudi economic growth to just 1.2 percent in 2016, the lowest in seven years.
On Wednesday, Standard and Poor's downgraded Saudi Arabia's credit rating for the second time since October.
"Saudi Arabia and other Gulf states are certainly suffering from low oil prices although they have strong fiscal buffers," Saudi economist Abdulwahab Abu-Dahesh said.
"They need higher oil revenues to reduce pressures on their currencies, domestic consumers and public spending," Abu-Dahesh said.
Saudi Oil Minister Ali al-Naimi insisted after announcing the output deal in Doha that low oil prices were not a problem for the kingdom.
Riyadh has fiscal reserves of more than $600 billion. Fellow Gulf countries within OPEC also have large cushions, but other members such as Venezuela, Algeria and Nigeria are not so fortunate.
Iran has suffered huge losses because of sanctions that shut off its access to much of the world oil market, while Russia has seen its recession-hit economy severely damaged by the price slump.
"The fact that Russia and Saudi Arabia are talking is a big plus" for oil prices, Seznec said.
Mistrust and the battle for market share remain the most serious obstacles to a lasting and effective deal, according to analysts.
While Saudi Arabia is willing to cut production if it sees that others will follow, it doubts Russia will do so, Abu-Dahesh said.
"Saudi Arabia simply does not trust Russia or Iran because of political and economic rivalries," he said.
"I don't think Gulf states want to lose their market shares to Iran. I believe that the fight for market share will only intensify," he said.
Tuvey said the Saudis may have wanted to appear sensitive to the concerns of other OPEC producers.
"It may be that the Saudis don't want to appear completely dismissive of fellow OPEC members' concerns, particularly at a time when many commentators are already calling the effective collapse of the cartel," he said.