In mid-July, the Russian Ministry of Foreign Affairs finally issued an agreement to Ahmed Al Wahishi who in early autumn will take up his duties as ambassador of Yemen to Moscow. Al Wahishi is the fourth candidate proposed by the Saudi-backed President Abd-Rabbu Mansour Hadi in the past year. Moscow rejected the previous three.

Over the last year, Saudi Arabia has been actively lobbying the Kremlin to accept Hadi's nominations. Russia's decision to concede comes after years of it opposing Saudi Arabia's intervention in Yemen and the government it backs. Even if it did not get involved in the conflict, Moscow silently acknowledged and backed Iran's interests in Yemen. In 2015, Sergey Lavrov warned that Russia would not allow the conflict in Yemen to escalate into a war against Iran.

So is Moscow's acceptance of Hadi's ambassador signalling a change in Russian-Iranian relations and a possible rapprochement with Saudi Arabia? Is Moscow risking losing its close ties with Tehran?

Russia drawing closer to Saudi Arabia?

A number of developments in recent months have signalled a possible rapprochement between Russia and Saudi Arabia.

The two countries have made a joint effort to push for further cutting of oil production to help bring up prices. Since the beginning of this year, Russian Minister of Energy Alexander Novak and his Saudi counterpart Khalid al-Falih have been seeking to conclude an agreement on reducing output.

In late May, then Deputy Crown Prince Mohammad bin Salman went to Russia to discuss with President Vladimir Putin the oil market and the situation in Syria. The visit came just three weeks before Crown Prince Mohammed bin Nayef was removed and bin Salman took his position. While in Moscow, the latter said that "relations between Saudi Arabia and Russia are going through one of their best moments ever".

Two months later, Moscow and Riyadh signed a preliminary military cooperation agreement worth $3.5bn. The Saudis have requested transfer of technology to accompany the signing of the deal.

In recent months, the two countries have also made significant progress on Syria. Under the patronage of Riyadh, Egypt provided a platform for negotiations between Moscow and the Syrian opposition.

The importance of this step for the Kremlin is obvious. Russia is extremely interested in concluding an agreement on de-escalation zones, the implementation of which is not possible exclusively within the framework of the tripartite initiative of Russia, Iran and Turkey, without the involvement of other actors. From this perspective, the role Saudi Arabia played in the signing of the two Cairo agreements between Russia and the Syrian opposition on East Ghouta and Rastan is very important.

Closer Russian-Saudi relations were seen as a positive step in Tel Aviv, Russia's "silent partner" in the Middle East. In recent years, Israel itself has enjoyed closer ties with Riyadh and its ally Abu Dhabi.

Divergence with Iran

Moscow's acceptance of Hadi's ambassador nomination would not be the first time Russian and Iranian foreign policy have diverged. Although Russia did not side with the Saudi-led coalition in Yemen, it also does not necessarily approve of Iran's war games.

For Iran, the Yemeni conflict, first of all, is a great way to weaken its main rival in the region - Saudi Arabia. Iran uses this conflict to draw the kingdom into a long-running and extremely costly war. Russia, which for many years has been seeking to strengthen and develop its relations with Saudi Arabia, is much less interested in violating the status quo on the Arabian Peninsula.

Any moves that might be perceived in Tehran as open disregard for its national interest or the formation of a Russian-Saudi alliance will have serious consequences on Russian-Iranian relations.

Iran and Russia also have divergent interests in Syria. Russia is largely driven by its security concerns and confrontation with the West, while Iran is pursuing to establish a regional foothold through dangerous sectarian policies

Currently, Iran and Russia have decided to ignore some of these differences in order to focus on propping the Syrian regime. But once a settlement of the Syrian conflict approaches, these issues would inevitably resurface.

The military coordination between the two countries has also been patchy. Neither is in a hurry to create joint command structures. Their coordination is occasional, and in most cases, the sides simply prefer to take parallel paths to the same destination. Moreover, on a number of occasions, Iran undermined Russian attempts to establish a ceasefire in Syria by provoking further local bloodshed.

And even significant efforts to improve bilateral relations have not led to the desired breakthrough in either economic or political sphere. Since the beginning of the new rapprochement in 2013, Moscow and Tehran have been steadily failing to boost the development of trade and investment cooperation. Russian and Iranian interests have also directly clashed over territorial ownership of the Caspian Sea and its legal status.

A sign of the problematic relationship between the two countries has surfaced during Rouhani's last visit to Moscow in March, which ended with no significant agreements.

Most of the documents signed during the visit were either non-obligatory memoranda of understanding or supplementary agreements to add some minor details to existing treaties.

The risk of abandoning Iran

Russia has pursued pragmatic policies, independent of Iran, including drawing closer to Saudi Arabia, but there is a limit to how far it can go. Any moves that might be perceived in Tehran as open disregard for its national interests or the formation of a Russian-Saudi alliance will have serious consequences on Russian-Iranian relations.

While Russia and Iran have a lot of issues to argue about, they also have a number of common interests in Syria, Iraq and Afghanistan, in Eurasian transit routes, the situation in Transcaucasia and Central Asia as well as in oil and gas markets.

If Russian-Iranian relations were to deteriorate, this would make dialogue on these issues extremely difficult. It would most definitely hurt Russian interests in Central Asia and Arab countries under strong Iranian influence. Russia would also risk losing joint projects with Iran in the oil and gas sphere.

In other words, Moscow has too much to lose from souring relations with Tehran.

Leonid Issaev is a lecturer at the National Research University Higher School of Economics.

Nikolay Kozhanov is academy associate at the Russia and Eurasia Program, Chatham House, and a visiting lecturer on the political economy of the Middle East at the European University, St. Petersburg.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.