Soviet support for Iran during the Iran-Iraq War
In the Iran-Iraq War, Iraq was the major client of the Soviet Union. Nevertheless, the Soviets hoped not to lose all influence. As a 1980 CIA document put it, "The Soviets see Iran as a greater geopolitical prize than Iraq...while hoping to prevent an Iranian turn to the West and to improve their own relations with Tehran", the Soviets also value their ties with Iraq.  They actually had relations with both sides; see the much more visible Soviet support for Iraq during the Iran-Iraq War.
After Mikhail Gorbachev took power in 1985, relations improved somewhat. "Support" began to include some diplomatic exchanges and economic cooperation, preparing the way for much better relations after the war ended in 1988. While the fall of the Soviet Union was not foreseen, Gorbachev took a long-term view of Soviet-Iranian relations.
In many eyes, the Iran-Iraq War was a proxy for the superpowers, although Iraq and Iran were intensely antagonistic; Saddam Hussein was the initiator of the war, not a third country. A senior Soviet official, Karen Brutents, explained that both superpowers considered the Third World the most plausible place for their proxy confrontations, and regarded it as an area of opportunity. According to Brutents, there were no critical issues there for the superpower.
There exists a very common notion that there was what the Americans called a "master plan" to take over the Third World and that all the individual operations were part of that strategy. Fortunately, or unfortunately, that wasn't so. I can guarantee that. I understand why such opinions appear. Putting aside the propaganda, that is the attempt to demonize the enemy. And secondly, regarding our scientists and politicians, that is attributing to the leadership more intellectual abilities than they in fact have, and presenting the matter as if things are all planned and calculated -- whereas in fact, the leadership's actions include a lot of zig-zags and chance and improvisations. — Karen Brutents
Iran, after the Western embargo of 1979, was motivated to expand its own manufacturing capability and to seek short-term, clandestine procurement of spares and replacements compatible with its Western equipment base. To the extent the Soviet Union could satisfy these needs, it had incentive to do so. Some equipment was shipped from satellite states such as Bulgaria,Poland and Romania. North Korea both shipped Soviet-designed weapons it made, as well as acting as a conduit for shipments directly from the Soviet Union and the PRC, even though China was a rival of the Soviets for Middle East influence. Certainly, Soviet clients, such as Libya and Syria, were providing Soviet products to Iran, and the Soviets did not announce a general embargo on them.  That the Soviets were willing do so selectively, as when they a proposed shipment of advanced naval mines from Libya to Iran, saying "opposed the unauthorized transfer of their military technology to a third country" indicates that some exports were tolerated. "After American officials told Moscow of the deal, Soviet officials said they opposed the unauthorized transfer of their military technology to a third country and informed the United States that they had made this policy known to Tripoli," according to Administration officials.
In spite of the antagonism between the U.S. and Iran, Timmerman observed that Iran, as the war continued, sought arms imports from countries that were not subject to, or complying with, U.S. export restrictions. Some of these countries were Soviet clients, or the Soviet Union itself By 1982, the United States Department of State estimated that more than 40% of Iran's annual $2 billion arms imports originated from North Korea. Much of this equipment was purchased from China or manufactured under license from the Soviet Union. Soviet-bloc weapons were also exported to Iran via Syria, Libya, Romania and Poland- and directly from the Soviet Union. Soviet-compatible equipment also came from the People's Republic of China, perhaps not a superpower but another rival of the Soviet Union. He cites U.S. estimates of Iran's arms imports over the 1979-83 period at $5,365 billion, viz:(emphasis) "$975 million from the Soviet Union, $1.2 billion from the US, $20 million from France, $140 million from the UK, $5 million from FRG, $150 million from Italy, $230 million from the PRC, $5 million from Romania, $40 million from Poland... and $2.6 billion from unspecified "other" sources."
Motivations for Policy
Motivations need to be understood in the context of the time of the Iran-Iraq War, between 1980 and 1988, in which the Soviet Union and the Cold War were still very real. The revolutionary forces that overthrew the Shah resented what they considered continuing U.S. support of an unpopular ruler. At the same time, the Iranian Revolution, starting in January 1978 and leading to the departure of the Shah in January 1979 was Islamic, so not automatically well disposed to a Communist government. Iran, having had an import-oriented policy of the time, needed to obtain weapons from one of the superpowers, or at least an ally who made equipment compatible with one of the superpowers.
Iraq's invasion of Iran, starting the Iran-Iraq War, came shortly after the 1978-1979 Iranian Revolution and the Iranian Hostage Crisis starting in November 1979. The U.S. had been strongly allied with the Shah of Iran, who had bought weapons from the West, primarily but not exclusively from the U.S. Iranian domestic opinion was anti-U.S. because the U.S. had been seen as the patron of the unpopular Shah, Mohammed Reza Pahlevi. The hostage crisis turned a good deal of U.S. public opinion against Iran, so even if the U.S. government, for reasons of state, wanted to support Iran in the Iran-Iraq war, it would face strong domestic resistance. The original U.S. policy of neutrality toward Iran and Iraq, with initial Iraqi military successes, made Iran more eager to find a source of arms, and the Soviet Union capitalized on this opportunity. U.S. domestic opinion was not as much pro-Iraqi as anti-Iranian, which created an opening for the Soviet Union to gain influence in Iran. The Soviets recognized that Iran saw both superpowers as antagonists, and remained open to opportunities, especially under Gorbachev.
Nevertheless, the fact that most Iranian equipment, and training on it, was American, meant that the Soviets could not immediately provide compatible equipment, meant to operate under the doctrines taught to the Iranian military who had not been purged by revolutionary forces.
The USSR, when the war broke out and a policy was not yet in place, arranged to fly jet fuel from Soviet bases to Tehran. This was followed, by Soviet-ordered shipments from Syria of 130 mm towed field guns M1954 (M-46), tank engines and ammunition. Arranged by Soviet Ambassador Vladimir Vinogradev, two Soviet-Iranian arms cooperation agreements were signed in July 1981. This agreement also provided Soviet advisors, justified as helping defend Iran against U.S. attack, as in the April 1980 Operation Eagle Claw hostage rescue.
Iran reassesses foreign arms dependence
After the revolution, from the early to mid-1980s, the Iranians were far more conservative about foreign dependence, so they focused more on internal production. A Military Industries Organization of the Ministry of Defense had been formed in 1969, but as given new authority, as the Defense Industries Organization, in 1981.  According to Globalsecurity, the DIO was, at the least, using Soviet designs as a basis for their own work; Iran said it hd manufactured an undisclosed number of Oghab rockets, by 1987 (i.e., still during the Iran-Iraq War) that were derived from Soviet-made Scud-B surface-to-surface missiles provided to Iran by Libya.
In 1983, other military manufacturing, controlled by the Islamic Revolutionary Guards Corps (IRGC)) was also authorized. This expanded, by the mid-80's, into the domestic capability to arms of moderate complexity, such as armored fighting vehicles, artillery, and some missiles and aircraft parts.  In all of these developments, direct and indirect technical help from many countries made it possible for Iran to rapidly expand the technical capabilities of her defense industrial base. These countries included...the USSR.
Soviet opportunities to gain influence, as part of broad strategy
Under Gorbachev, new models of Soviet political thinking emerged, which Fukuyama calls "hard" and "soft".  The "soft" variant deemphasizes shared ideology as grounds for assistance, but generally decreased Soviet military aid to the Third World. The "hard" variant, proposed by Karen Brutents (first deputy chief of the Central Committee International Department) and Aleksandr Yakovlev (Politburo member and head of the Foreign Policy Commission), wants cooperation with "large, geopolitically important Third World States, regardless of their ideological orientation." Fukuyama wrote
"The area of heaviest Soviet involvement with capitalist Third World states has been the Middle East/Persian Gulf. Moscow has...moved closer to Saudi Arabia and Iran..."
As mentioned in the introduction, Mikhail Gorbachev had a new model of Soviet foreign policy when he came to power in 1985. Rather than supporting only ideologically compatible state, he saw country-specific bilateral agreements, involving economic cooperation, as a means of offsetting US power in the Gulf. Consequently, his “new thinking” also seemed to facilitate a change in Iran’s views towards the Soviet Union. This thinking may have complemented Iranian awareness of their need to improve their economy. In February 1986, therefore, Soviet Deputy Prime Minister Georgi Kornyenko visited Tehran on February 26, 1986, hoping for economic cooperation.
Iran agreed to “expand economic and trade relations, and to conduct joint oil exploration in the Caspian Sea.” This gave Gorbachev some ability to balance interests between Iraq and Iran.  Iranian official radio broadcast that he urged "increased political contacts". Hashemi Rafsanjani,Speaker of the Iranian Parliament, said Kornyenko's visit, "will have a great effect on our relations with the Soviet Union and the Eastern world...One can be optimistic in fields such as technical, military, economic and possibly political relations. Soviet policy towards Afghanistan and Iraq, however, remained a problem. " Iran, shortly after the visit, launched an offensive that regained the Fao Peninsula. Followup Soviet official visits, in August and December 1986, resulted in the resumption of Iranian natural gas exports, which had been halted in 1980.
Other opportunities, although primarily realized after the war ended, involved Soviet technology for components and systems beyond the short-term capabilities of Iran to design. Iran had reason to explore Soviet willingness export missile system components that the Iranians could adapt, do final assembly of Soviet aircraft and armored vehicles, and establish licensed Soviet equipment factories in Iran.< This primarily happened after the war's end in 1988.
US considers reopening embargo to balance Soviet influence
In 1985, a CIA analyst,Graham Fuller, had proposed that the US should offer to sell weapons to Iran, as a means of blocking Soviet influence there. Robert M. Gates, then head of the CIA National Intelligence Council, advanced the suggestion, which circulated over the signature of Director of Central Intelligence William Casey. While the section was rejected by the incumbent Secretary of State George Schultz and Secretary of Defense Caspar Weinberger, it reinforces the idea that the Iran-Iraq conflict was seen as a proxy war by the U.S., and possibly the Soviet Union. Certainly, the Soviet Union would sell to post-revolutionary Iran after 1979, when the U.S. would not.
Apparently, the Soviets also saw opportunities at the same time, presumably to block U.S. influence. In 1985, the Iraqi defense minister said, "Eighty percent of the weapons we capture today (from Iran) are of Soviet origin" 
Soviets explore opportunities
Fukuyama observes that the Soviet policy toward the Persian gulf, in 1987 and early 1988, was complex, with several competing goals. Overall, they sought to increase Soviet influence in the region, especially if Western navies left the area. When they made the tactical mistake of chartering tankers, they quickly adapted to moving the Western forces out of the Gulf, "by tilting away from Kuwait and towards Iran. Over the summer of 1989, the Soviets probably hoped the United States could be frightened out of the Gulf...Bolstering Iranian opposition to reflagging would contribute to this result." Such a tilt would serve the objective of building influence with Iran, while offsetting the United States' extensive support to Kuwait. 
Under the Soviet system, there was little incentive for highly profitable arms exports. Rather, Soviet arms exports were first and foremost governed by military secrecy. If the military determined that a particular piece of equipment, manufacturing technology, or other information was ahead of the equivalent in the West, it would not be available for export, and the foreign military sales organizations of the Soviet Union had no means to appeal.
If there was a question of sensitivity, traditional Soviet decisionmaking was for more, not less, secrecy.  Every decision about exporting things of perceived military significance were made centrally, with Party, military and State Security (KGB) input. If a decision was made in favor of exporting, it reflected a consensus of the government.
In 1981, a Central Intelligence Agency document said that the Soviet Union is likely to hasten the delivery of $220 million in "ground equipment", and to permit Eastern European countries to "selectively provide some items in short supply." 
Military training and advice
The July 1981 military agreements were described by the Iranians as defensive. They covered training and construction of Iranian bases, but also the construction of Soviet signals intelligence (SIGINT) bases (see Command, control, communications and intelligence below). There were agreements to train Iranian personnel in Soviet military schools, and cooperate with the revolutionary secret police, SAVAMA.
Advisors were to wear distinctive uniforms, but with nothing that identified them as Soviets, and were to have their expenses paid in U.S. dollars. The number grew to 3000 by mid-1983, and 4200 in March 1987. 
Soviet personnel, in late 1981, started construction of a surveillance station in Baluchistan, in a location that gave a view of the Afghan and Pakistani borders. Radar at this base could monitor all naval traffic through the Strait of Hormuz. They could also monitor supply to the Afghan resistance that came through Pakistan. The Shoravis were also remarked in Balouchistan, where starting in late 1981 they began work on a network of ground surveillance stations that would be linked to an enormous listening base dug into the side of Kuh-e-Malek-Siah mountain, which dominated the Iranian-Afghan-Pakistani border. Iran allowed this due to concern over the increasingly warm relations between Pakistan, the U.S., and the Arab states of the Persian Gulf. Tehran agreed to let the installation be built.
Complementing the first station at Kuh-e-Malek-Siah, an intelligence base at Gardaneh Pireh Zan allowed surveillance of air activity in northern Saudi Arabia. Coupled with other Soviet intelligence facilities in South Yemen, Ethiopia, and Syria, the installations achieved complete coverage of the Arabian Peninsula.
Smaller intelligence bases ran on a line Khash, Paskouh, Faslabad, Kalateh-Shah-Taghi, and in the Birag valley. These were operational by 1983-1984. 
Both sides captured tanks and other major equipment for the other. Iran developed an enhanced version of the T-54/T-55 tank. It is not clear if Iran ever obtained Russian spare parts for this elderly tank.
While the U.S. officially embargoed parts for the F-14 and its specialized AIM-54 Phoenix long-range air-to-air missile, and there are reports that U.S. technicians, leaving Iraq after the Revolution, sabotaged critical parts, the Iranian Air Force found a new role for its F-14 fighters, in command and control. Its AN/AWG-9 radar, unique in capability at the time, allowed Iran to use the F-14's not as front-line fighters, but as "mini-AWACS" early warning and tactical control platforms.
The F-14 and Phoenix have been retired in U.S. service, and there were recent reports of Iran getting spare parts from surplus sales. Obviously, current surplus sales did not affect F-14/AWG-9 use in the war under discussion, but the Associated Press report on the current market quoted Greg Kutz, head of special investigations for the U.S. General Accountability Office as saying "He believes Iran already has Tomcat parts from Pentagon surplus sales: "The key now is, going forward, to shut that down and not let it happen again." 
For Iran, the radar is the critical component for the F-14 system. The Phoenix missile was designed for engaging Soviet bombers at very long ranges, in the Outer Air Battle component of the defense of an aircraft carrier battle group, and there are few threats of this type with which Iran needs to cope.
There have been U.S. industry reports that at least one F-14 crew defected to the Soviet Union. At the time, the F-14 avionics were well ahead of Russian systems of the time, so this might have been an intelligence coup. 
These reports suggested that the Vympel R-33 missile (NATO reporting name AA-9 AMOS) was reverse-engineered. Gennadiy Sokolovskiy of the Vympel Design Bureau denies that the R-33 was based on the [[AIM-54 Phoenix[[, maintaining that he has never actually seen a live Phoenix."]
F-14 aircraft in Iranian service also carry the AIM-9 Sidewinder and AIM-7 Sparrow missiles, plus a 20mm cannon; all these are more appropriate for the likely type of combat these aircraft would face -- if they are used in combat. Given their unique radar capability, Iran would be more likely to hold back its F-14's and use other fighters, such as the F-4 Phantom, for close engagements.
During the war, Iran did not have an integrated air defense system. It did have local air defense systems at Tehran and Kharg Island, a key Iranian oil facility. Soviet antiaircraft artillery was a key and predictable part of these local defenses, since Iran had significant difficulties obtaining spare parts for its U.S. MIM-23 Hawk surface-to-air missiles  These included Soviet antiaircraft artillery and short-range missiles. It is not established how Iran acquired these weapons, which are short-range and presumably used as final point defenses.
The Kharg Island defenses included the well-regarded ZSU-23-4 radar-controlled 23mm antiaircraft cannon.
Also part of the Kharg Island air defenses were shoulder-fired Strela SA-7 surface-to-air missiles. These missiles have a limited shelf life under less than ideal storage conditions, so they cannot have been acquired too long before the Revolution. 
In 1985, Iran recognized the embargo forced it to simplify its domestic production goals. One goal was surface-to-surface missiles, which, perhaps counterintuitively, can be less complex than a multirole fighter aircraft such as the U.S. F-4 Phantoms that were the backbone of the Iraqi Air Force.
Iran obtained technical assistance from a number of countries, including China and North Korea, Pakistan, Israel, Argentina, Brazil, West Germany, East Germany, Taiwan, and the USSR . Of these, in 1985, the Soviet Union clearly had the greatest missile expertise. Iran used Scud-B SSMs, presumed to be of Libyan origin, and to which the Soviets voiced no objection.
- Central Intelligence Agency (18 December 1980), Special National Intelligence Estimate: Soviet Interests, Policies, and Prospects with Respect to the Iran-Iraq War, SNIE 11-34/36.2-80
- , Episode 17, Good Guys, Bad Guys: Interview with Karen Brutents"COLD WAR", CNN.com, October 1997
- Kenneth Timmerman, Chapter 9: Iran's new Soviet Arsenal, "Fanning the Flames: Guns, Greed & Geopolitics in the Gulf War", Iran Brief
- National Intelligence Council, Iran: Current National Security Situation
- Sciolino, Elaine (September 11, 1987), "U.S. and Soviet Protest to Libya Over Iran Mines", New York Times
- Timmerman, Kenneth R., Chapter 7: Operation Staunch, "Fanning the Flames: Guns, Greed & Geopolitics in the Gulf War", Iran Brief
- United States Arms Control and Disarmament Agency (1985), World Military Expenditures and Arms Transfers, Government Printing Office
- "Defense Industries Organization (DIO)", Globalsecurity.org
- Fukuyama, Francis (1989), Gorbachev and the new Soviet Agenda in the Third World, Rand Arroyo Center, at v-vii
- O’Connor, Edward A., "Russian-Iranian Relations: Outlook for Cooperation with the “Axis of Evil”", Strategic Insights
- Associated Press (3 February 1986), "Soviet Official visiting Iran", New York Times
- Reuters (10 February 1986), "AROUND THE WORLD; Iranian Says Ties With Soviet Improve", New York Times
- Hume, Cameron R. (1994), The United Nations, Iran, and Iraq: How Peacemaking Changed, Indiana University Press
- Engelberg, Stephen (23 February 1987), "C.I.A. Nominee tied to '85 Memo urging Iran Arms Deals", New York Times
- Fukuyama, Francis (1989), Gorbachev and the new Soviet Agenda in the Third World, Rand Arroyo Center, at 50-58
- Office of International Affairs (OIA), National Academy of Sciences (1997), Efforts of Russia, Ukraine, Belarus and Kazakstan to Establish and Upgrade Export Control Systems: Inheritance from the USSR, Proliferation Concerns: Assessing U.S. Efforts to Help Contain Nuclear and Other Dangerous Materials and Technologies in the Former Soviet Union, National Academies Press, at 91
- National Foreign Assessment Center, Central Intelligence Agency (20 November 1981), Iran-Iraq War: Status, Impact and Prospects, CIA/NESA 81-10049 M
- "Tuning In", Time, 8 March 1982
- Theimer, Sharon (16 January 2007), "Iran Gets Army Gear in Pentagon Sale", Associated Press
- Baugher, Joseph (3 March 2000), "Tomcat In Service with Iran", AirToAirCombat.com
- Alexander, Greg (12 May 2002), "Iranian Air Force F-14", Aerospace Web.com
- Davis, Mark J. (1992), Iranian Operational Warfighting Ability: An Historical Assessment and View to the Future, School of Advanced Military Studies, U.S. Army Command and General Staff College
- Segal, David (March-April 1986), "The Air War in The Persian Gulf", Air University Review
- Airline Pilots Association (ALPA) MANPADS Task Force (October 2004), "MANPADS Task Force Update:ALPA line pilot security experts and staff have been examining the threat to airliners from shoulder-fired missiles", Air Line Pilot