By Vladimir Soldatkin, Sam Wilkin and Tom Finn
DOHA (Reuters) - It was supposed to be the easiest deal ever reached among key oil market players, a mere formality.
Eighteen countries were gathering in the Qatari capital of Doha to rubber-stamp the first joint agreement between major OPEC and non-OPEC nations in 15 years, tackling a huge global glut after flooding the market for two years.
The text was agreed and the timeframe was clear. Oil prices were rising. Traders were calling the event boring.
Then, the first clouds began to appear.
Thousands of kilometers away from Doha, at a Friday summit of the Organization of Islamic Cooperation in Istanbul, Saudi King Salman bin Abdulaziz and Iranian President Hassan Rouhani gave each other the cold shoulder in front of cameras after the 57-member group accused Iran of supporting terrorism.
The frosty tone was noted and quickly became a talking point among some delegates and OPEC watchers in Doha.
None of the OPEC and oil industry sources who spoke to Reuters linked the subsequent collapse of the oil meeting in Doha to the events in Istanbul directly.
But they said it was indicative of the deep mistrust between the Sunni Muslim kingdom and the Shi'ite Islamic republic, which compete for influence in the Middle East and are currently fighting proxy wars in Syria and Yemen.
From Friday onwards, things went downhill.
Only a few days before the Sunday meeting, Saudi Arabia surprised Qatar by demanding that it cancel Iran's invitation to the talks, arguing that only those countries which were ready to freeze output should attend, according to sources familiar with the discussions.
Iran has long said it wanted to regain market share following the lifting of sanctions in January and assumed that Venezuela and Russia -- the two proponents of the freeze deal -- had managed to persuade the Saudis the plan was worth signing even without Tehran's involvement.
The sources said the Saudis told Qatar that if Iran showed up at the meeting without agreeing to the output freeze, there could be no deal.
FLURRY OF SURPRISES
Qatar's Emir, Sheikh Tamim bin Hamad al-Thani, was a main proponent of the deal, and even made a January visit to Moscow specifically aimed at talking about the idea with Russian President Vladimir Putin, oil industry sources said.
Qatar delivered the message to Tehran on Friday and after some delicate diplomatic maneuvering, Iran said hours later it was happy not to attend, to the relief of the talks' participants.
But that was not enough to seal the deal.
Back in Saudi Arabia, Deputy Crown Prince Mohammed bin Salman, the kingdom's top oil official and second in line to the throne, said in an interview published on Saturday that Riyadh would only restrain its output if all major producers, including Iran, agreed to freeze production.
At the Doha meeting the next day, Saudi veteran oil minister Ali al-Naimi, delivered the same line, scuppering the agreement.
It remains unclear for the moment how Prince Mohammed and Naimi reached their decision, and whether they were in alignment on the reasons.
In addition to wanting to punish Iran, the Saudis might have been driven by a reluctance to help prices recover too soon because it could allow rival producers, including in the United States, to resume production growth, delaying a rebalancing of the market beyond this year, according to sources.
But one thing is certain, sources say: although the Saudis' Gulf allies quickly came into line behind Naimi, his decision came as a complete surprise, highlighting how the kingdom -- which traditionally consults with Kuwait, the UAE and Qatar -- appears to be changing under its new assertive and pragmatic leadership, of which Prince Mohammed is a main player.
Global oil prices first started plummeting in late 2014 after Saudi Arabia increased production volumes to drive higher-cost producers such as U.S. shale firms out of the market.
Russia's energy minister asked Naimi on Sunday if any kind of binding deal to freeze output would be possible, according to sources.
In a sign of possible new battles for market share, Naimi said no.
"Once again the Saudis have delivered a hammer blow to fellow producers," said David Hufton, managing director of PVM brokerage.
"It promises to be the final nail in the coffin for those shale producers and their lenders hanging on for a short-term price reprieve."