The escalating Persian Gulf war is handing Moscow a chance to widen its influence with Iraq and Iran, after a period of tension with both strategically placed rivals.
Having recently improved its stock with Iraq by resuming arms shipments there after a three-year hiatus, the Kremlin is now playing host to an envoy from Iran.
Anything resembling a Soviet-Iranian rapprochement seems out of the question at least for the present.
Diplomatic ties between Moscow and Tehran have seldom been worse. Iran is cracking down on its own pro-Soviet communists, and ousted a group of Soviet diplomats on spy charges last year.
But the Moscow visit by Mohammed Sadr, a senior Iranian Foreign Ministry official, underscores what one Arab political analyst recently termed ''Moscow's continuing potential for leverage'' in the longer run on Iran.
Mideast news reports wasted little time after the announcement of the Iranian envoy's departure for Moscow Sunday in signaling one area for such potential leverage: Moscow's ability to calibrate its resumed arms deliveries to rival Iraq.
But there are other areas, too.
At a time when the Iraqi-prodded ''tanker war'' in the Gulf is trimming Iran's crucial oil-export revenues, one possibility for taking up at least a bit of the slack is an existing gas pipeline between northern Iran and the Soviet Union.
The Iranians shut down that conduit over a price dispute after the toppling of the Shah more than five years ago, and have kept it shut amid gradually worsening ties with the Kremlin.
It is impossible to predict whether there will be any short-term movement on the pipeline issue. But Soviet-Iranian land transport did greatly expand when Iran experienced trade difficulties because of a Western boycott during the American hostage crisis.
Another area of potential Soviet leverage on Iran, Arab analysts point out, would be to encourage unrest in northern Iran near the two countries' border.
Iran's President Ali Khamenei visited that area last month. At the time, an antigovernment radio broadcast linked the visit to what it termed unrest there. There has been no independent confirmation of such trouble. But Iran has a longstanding suspicion of Soviet intentions in the border area, fueled by Moscow's support for a short-lived secessionist state there after World War I.
Continuing Soviet media criticism of the Iranians, notably for the crackdown on local Communists, suggests Moscow is not about to ''tilt'' toward the Iranians in the Gulf war so soon after having tilted in the other direction. Iranian media invective against the Soviets, too, has not visibly lessened.
More likely, the Iranian visitor, who was invited by Moscow, will be told that it is high time for the Iranians to soften their terms for a negotiated resolution of the nearly four-year-old Gulf conflict.
Although the Soviets, as the world's top oil exporter, could benefit from the escalating war, they are also seen as worried that the conflict could push Arab oil states strategically and militarily closer to the West.
For more than a year, Moscow has publicly called on Iran to make peace. This represented a change in the Soviet position following Iran's switch from merely taking back territory lost in Iraq's original assault, to attacking Iraqi territory.
Until then the Soviets, despite a formal friendship and assistance pact with Iraq, had remained virtually neutral in the conflict.
Yet the Moscow visit could be met by a Soviet effort to improve tumbling relations with Iran at least slightly. A hint of this came in late April during a regular Tehran meeting of the joint Soviet-Iranian transport committee.
The hostage-era boom in Soviet-Iranian transport seems to have survived worsening political and diplomatic relations between the two countries.
Soviet media reports on the recent committee session said about a fifth of all Iranian imports, notably from Europe, were now passing over Soviet soil ''in view of the difficulties . . . through Persian Gulf ports.''
The Soviet reports said agreement was reached at the meeting ''to continue cooperation in preparation of plans'' for a new Iranian-Soviet rail link.
But Moscow apparently failed to win Iranian approval on a proposal to build new frontier bridges on the Aras and Astarachay Rivers.
Moscow radio's Persian-language service noted, in a report at the start of the committee session, that the existing bridges, of World War II vintage, were in ''unsatisfactory condition.''
''If this project is carried out, favorable conditions will be created for an increase in the volume of transit of goods between the Soviet Union and Iran,'' the radio said.