Russia plays the Iran game cleverly. Visiting Iran for an oil deal 10 years ago, I was asked whether I was a Russian working on the nuclear plant at Bushehr, on the Gulf coast. I was surprised at the question but perhaps I shouldn't have been: Russia had been involved in the project since 1995. The Russians had restarted work that a German company had begun 20 years earlier. On Saturday, they finally began loading the plant with fuel and Bushehr should start generating electricity by the winter.
The nuclear plant is just one piece of Russia's relations with Iran. Russia is cleverly playing both sides of the interminable Iran-US controversy, profiting both in money and in diplomatic capital. As always, energy is at the centre of Russian strategy. Russia has not gone along with US and EU sanctions on oil product sales to Iran, imposed over the Islamic Republic's alleged nuclear weapons programme. Given its position on the Caspian Sea, this opens a major back door to Tehran. And Russia continues to dangle before the Iranians the prospect of selling S-300 surface-to-air missiles, which could defend nuclear sites from an American or Israeli air strike.
When the non-state Russian oil company Lukoil, with major assets in the US, felt compelled to suspend operations in Iran, Gazprom Neft, the subsidiary of the Russian national gas giant Gazprom, swiftly stepped in. Gazprom is already involved in developing South Pars, Iran's half of the world's largest gasfield, shared with Qatar. Yet the Russians give conflicting messages. In June, the president Dmitry Medvedev supported new UN sanctions on Iran, and the Iranian president Mahmoud Ahmadinejad responded angrily. "We regret the fact that Medvedev has become the spokesman of … the plot hatched by Iran's enemies," he said.
An undiplomatic riposte, given that Russia, with China, had been one of the two permanent members of the UN Security Council relatively friendly to Tehran and that, at Russian insistence, Bushehr had been specifically excluded from sanctions. The Kremlin official Sergei Prikhodko fired back: "No one has ever managed to save his authority by making use of political demagoguery." Moscow is not keen for a confrontation with Washington and has no wish to see a nuclear-armed Iran emerge as a regional rival. The contracts with Iran - US$1 billion (Dh3.67bn) for Bushehr, $800 million for the missiles - are significant but not valuable enough to decide national policy. Bushehr itself is very unlikely to be a nuclear proliferation risk: spent fuel will be returned to Russia for reprocessing and any attempts to divert fuel would be detected.
A primary Kremlin goal is to prevent Iran emerging as an energy competitor. Iran is a key potential supplier for Nabucco, the planned EU-backed gas pipeline to connect the Middle East and Caspian to Europe and diminish dependence on Russia. By attracting exports from Russia's "near abroad" - the ex-Soviet states of Azerbaijan, Turkmenistan and Kazakhstan - Nabucco could break Russia's near-stranglehold on central Asian gas.
If Iranian projects cannot be delayed indefinitely, Russia would rather steer South Pars gas towards Pakistan and India, which are not Gazprom customers. Gazprom has already lost heavily in its core European market as a wave of competing Qatari liquefied natural gas (LNG) supplies has arrived but an Iranian LNG industry needs western investment and technology. And in the Gas Exporting Countries Forum, seen by some as an embryonic gas OPEC, Russia hides behind the firebrands Iran and Venezuela, ironically not even net gas exporters yet, to maintain its own market dominance.
Russia is the world's largest oil producer but its high-cost, heavily-taxed fields badly need high prices. The continuing crisis over the nuclear programme and nervous oil markets, without actual hostilities, is ideal. At the same time, despite Iran's vast oil resources, under-investment is leading to declining production. This at least partly counterbalances the threat of a resurgent Iraq flooding the market.
This demands a delicate balance - Iran must be strong enough to resist the US but not so powerful that it competes aggressively with Russia in oil and, especially, gas markets. Yet Russia may not be as Machiavellian as it appears. Its policy is driven not only by geopolitical grand designs but, perhaps even more, by short-term advantage, lobbying from powerful domestic political and business interests and diplomatic trade-offs with the US over other issues.
As befits a nation with long memories, the Iranians do not forget historic tussles with Russia: in the 19th century they lost Armenia and Azerbaijan to the tsars, while as recently as 1946 the then Soviet Union set up two communist republics in Iran that were removed only after astute diplomacy. Mr Ahmadinejad even made a demand for compensation last year. The Iranians clearly do not trust the Russians. Yet their paranoia about the West has pushed them into this dependence on Russian machinations. The regime has managed to unite against itself an odd coalition: the Americans, Europeans, Israelis and most Arab states. Even China, hungry for Iranian oil, was persuaded to back UN sanctions.
But in the economic sphere, Iran's biggest competitor is Russia; conversely, the US and EU are potentially lucrative customers. Under even moderately favourable conditions, as in Iraq, western and Asian oil companies would pay highly for the chance to invest in Iran's fields. As so often in the Middle East, politics trumps economics. Such situations are inherently unstable: Russian dominance of central Asian gas is slowly being eroded, while the Europeans have a big interest in securing alternatives to Russian energy supplies. But as long as the stand-off over Iran's nuclear programme continues, the Kremlin can probably continue to play its clever double game.
Robin M Mills is an energy economist based in Dubai and the author of The Myth of the Oil Crisis