President Vladimir Putin urged the world to celebrate Tuesday's six-power nuclear deal with Iran, but the agreement carries risks for Russia because it could drive down oil prices.
Moscow sees the deal, which offers Iran relief from sanctions in exchange for curbing its nuclear programme, as opening the way to selling Tehran missile defence systems and winning lucrative new nuclear energy contracts.
But it also creates uncertainty for Moscow as the reintroduction of Iranian oil onto world markets could push down global prices and cause further damage to Russia's struggling economy, which is heavily dependent on oil exports.
Unsurprisingly, the Kremlin chose to stress the positives from the deal, clinched after marathon talks in Vienna between Iran and a group of countries including the United States and Russia, to reassure the Russian people they would see gains.
"The world can now breathe a sigh of relief," Putin said in a statement. He said the agreement would spur civilian nuclear cooperation between Russia and Iran, and contribute to combating terrorism in the Middle East.
Foreign Minister Sergei Lavrov made clear Russia expected some reward for backing the deal, suggesting Washington should abandon plans to base missile defence systems in Europe.
"We all probably remember that in April 2009 in Prague President (Barack) Obama said that if the Iran nuclear programme issue is sorted out, then the task of creating the European part of the missile defence system will disappear," he said.
Lavrov also held out the possibility of Russia selling arms to Iran soon, despite a weapons embargo that will remain for the next five years. "In the next five years deliveries of arms to Iran will be possible, under the conditions of the relevant procedures, notification and verification by the U.N. Security Council," he said.
Glass Half-full or Half-empty?
The intention was clear - to show that for Russia the glass is half-full rather than half-empty.
Some observers had suggested it did not really want an agreement, mainly because of the possible impact on oil prices and out of concern that Moscow would lose global standing if Iran's relations with the United States improved.
The agreement deprives Moscow of a bargaining chip with Washington, and potential influence in the Middle East, because Russia's relatively good ties with Iran gave it a role in the talks which the United States could not ignore.
But Russia calculated that a deal was inevitable and that it was vital to get a head start in the race to reap political and economic benefits once an accord was reached.
Putin began moves to improve relations with Tehran when he returned to the presidency in 2012, and redoubled those efforts when the West imposed economic sanctions on Russia last year over its role in the Ukraine crisis.
Russian news agencies quoted various officials on Tuesday who talked up possibilities for cooperation, including in the oil and gas, rail, nuclear energy and electricity sectors. Trade with Iran, one ministry said, was bound to increase.
Some deals are already in place.
Russia agreed last November to build two more nuclear reactors in Iran, with the possibility of a further six, after years of cooperation over the construction of Iran's Bushehr nuclear plant.
Moscow also said in April that it had started an oil-for-goods swap with Tehran under which it would buy up to 500,000 barrels of Iranian oil a day in return for cash, Russian goods and services.
Another area where Russia sees good prospects for trade is in arms. Soon after world powers and Iran reached an interim nuclear deal in April, Putin signed a decree lifting a ban on the delivery of S-300 anti-missile rocket systems to Iran.
Interfax news agency quoted a source "familiar with the situation" who made clear Moscow would go ahead with the S-300 sales even though the arms embargo remains.
Will Russia Come Out On Top?
The big questions now are whether Moscow can turn improved ties into trade contracts, and how oil prices are affected.
Ivan Kopeikin, an analyst at BCS Express brokerage, said the likelihood of an Iran deal had already been factored into prices and that he expected no significant further change.
That will encourage Moscow, but analysts say much still has to be done for it to come out on top from the deal, either economically or politically.
Global intelligence firm Stratfor said this month the increase in Iranian oil reaching world markets could reduce Russia's ability to use energy as a political weapon against Europe, which depends heavily on Russian supplies.
"Russia's influence in the Middle East is fading rapidly at the same time Europe is starting to wriggle out of Russia's energy grip. And as Russia's options are narrowing, U.S. options are multiplying in both the Middle East and Europe. This is an uncomfortable situation for Putin, for sure," it said.
(By Timothy Heritage; Editing by Mark Trevelyan)