North Korea obtained its first R-17 missiles from Egypt in 1979 or 1980, in return for assistance during the Yom Kippur War. As relations with the Soviet Union were rather strained at the time, and Chinese assistance had proven unreliable, the North Koreans set about reverse engineering the Egyptian missiles. This process was accompanied by the construction of a missile-building infrastructure, of which the main elements were the 125 factory at Pyongyang, a research and development institute at Sanum-dong and the Musudan-ri Launch Facility.
The first missile prototypes were completed in 1984. Designated Hwasong-5, and known in the West as the "Scud Mod. A", they were identical to the R-17Es obtained from Egypt. The first test flights occurred in April 1984, but the first version saw only limited production, and no operational deployment, as its purpose was only to validate the production process.
Production of the definitive version of the Hwasong-5 ("Scud Mod. B" or "Scud-B") began at a slow rate in 1985. The type incorporated several minor improvements over the original Soviet design. The range with a 1000 kilogram warhead was increased from 280 to 320 kilometres, and the Isayev engine was slightly modified. An array of payloads was developed, including high explosive (HE), cluster, chemical, and possibly biological warheads. Throughout the production cycle, until it was phased out in favour of the Hwasong-6 in 1989, the DPRK manufacturers are thought to have carried out small enhancements, in particular to the guidance system, but the exact details are unknown.
In 1985, Iran acquired 90 to 100 Hwasong-5 missiles from North Korea in a deal worth US$500M. As part of the deal, North Korea agreed on a missile technology transfer, and it helped Iran establish a production line. In Iran, the Hwasong-5 was produced as the Shahab-1.
- Bermudez, Joseph S. (1999). "A History of Ballistic Missile Development in the DPRK: First Ballistic Missiles, 1979-1989". James Martin Center for Nonproliferation Studies. Retrieved 2008-02-14.