Russia and Iran seemed to be good friends, but in recent weeks the relationship has unravelled.
Since 1991, Russia has been a major supplier of modern arms to Iran.
The Russian-built nuclear power plant in the southern Iranian city of Bushehr is due to finally come on line this year.
In advance, Russia has shipped more than 100 tonnes of low-enriched uranium reactor fuel rods to Bushehr. Moscow has earned billions, helping Iran bypass US and European Union (EU) sanctions.
And yet, last month, Moscow supported UN sanctions against Iran over its nuclear programme.
Last week, President Dmitry Medvedev even publicly questioned the Iranian programme which is moving into a position that may allow Tehran to acquire nuclear weapons.
Previously, Russian officials maintained that there was no proof that Iran was developing nuclear weapons.
In December 2005, Russia agreed to sell Iran long-range S-300 anti-aircraft missiles - 40 to 60 launchers with four missile tubes each, radars, and control stations, worth some $1bn (£650m).
Together with the shorter-range Tor M1 and the older super-long-range S-200 already provided by Russia, Iran could build a solid anti-aircraft shield able to defend its nuclear facilities against a possible US or Israeli assault, and inflict serious damage to the attacking force.
Without the S-300, the Iranians do not have a balanced air defence.
Moscow has been withholding the delivery of the S-300 to Iran since 2008, while officials maintained the delays were "technical".
Last month, after some hesitation, Moscow announced that the S-300 deal is forbidden by the new UN sanctions.
Iranian officials reacted angrily. Defence Minister Ahmad Vahidi demanded that Russia must pay for the damage it has caused by failing to deliver the S-300.
President Mahmoud Ahmadinejad has publicly berated Mr Medvedev for buckling under what he said was US pressure for fresh sanctions.
Moscow's policies towards the Middle East are clearly very different from its Cold War stance, when it steadfastly supported Muslim nations against the US and its closest ally, Israel.
Today Russia is seriously distressed by the spread of Western influence and the expansion of the North Atlantic Treaty Organisation (Nato) into what it considers its legitimate sphere of "privileged interests": Ukraine, Georgia and other former Soviet republics.
The Middle East today is too far from Moscow's true sphere of interest or capability.
If Washington under Barack Obama seems to be less intrusive in the post-Soviet space, if Israel obediently agrees to stop the supply of modern weapons to Georgia - like it did in 2008 - Russia is ready to be forthcoming on Iran.
The threat of Iran acquiring nuclear weapons is also a factor, but hardly the main one.
The Russian military do not consider a handful of primitive North Korean or Iranian nuclear weapons a serious threat.
Of course, Moscow has genuine business and security interests in the larger Middle East: supplying arms and nuclear technologies to Arab nations and to Iran.
At the same time, Russia has an increasingly important military and security relationship with Israel.
With Israel, Russia has been jointly producing billions of dollars worth of weapons for India.
The Russian military have acquired a substantial batch of different types of Israeli-made spy drones or unmanned aerial vehicle (UAV), the first official procurement of a major weapon system from a Western nation since 1945.
Moscow is at present negotiating the joint production of UAVs with Israel in Russia.
In the absence of a clear, overriding strategic interest in the Middle East, Russia's policies are highly opportunistic and can be easily changed by lobbying or intrigue.
There is no evidence that Mr Medvedev and the all-powerful Prime Minister Vladimir Putin seriously differ on Iran.
But Tehran's anti-American policies, as well as its purchase of Russian military and nuclear technologies, helped to build a powerful lobby in Moscow.
The cancelling of the S-300 sale when the due process of vetting by all required government agencies was complete, and the hardware ready for shipping, has financially hurt influential officials and caused anger.
But Tel Aviv also has a lobby in Moscow.
An additional factor that may further influence the decision-making in Moscow is Saudi Arabia's offer to buy more than $2bn worth of Russian weapons (helicopters, armour, anti-aircraft missiles) on condition that Russia does not sell Iran S-300 missiles, and stops supporting it in the UN.
Working in apparent cohesion, Israelis, Arabs, Russians and Americans have somewhat changed the traditional outlay of Middle Eastern great power rivalry.
But the Iranian nuclear problem seems to be as far from resolution as ever.