In 1975, the USSR actually fired a cannon from an orbiting space station.
From the very beginning of the space age, the Soviet military was worried about the prospect of the approach of American spaceships and the capture of Soviet military satellites. It wasn't crazy. The fear of an attack on spacecraft was real, and anti-satellite weapons were being developed on both sides of the Iron Curtain. In the 1960s, it seemed perfectly logical that military and manned spacecraft would need self-defense weapons.
An early project for a Soviet space station, codenamed Almaz, was the first real project to create a defensive space weapon. The inhabited outpost was intended almost exclusively for military purposes, starting with reconnaissance. Almaz had to have a cannon in its arsenal along with modern spy equipment such as cameras and radars.
The development of weapons was entrusted to the Moscow design bureau "Tochmash" under the leadership of Alexander Nudelman, whose engineers distinguished themselves for many breakthroughs in the field of aircraft weapons after the Second World War. For this project, Nudelman's team developed a 14.5mm rapid-fire cannon that could hit targets up to 3 km away. The gun could fire from 950 to 5000 rounds per minute, firing 200-gram projectiles at a speed of 690 meters per second. According to the veterans of the Almaz project, during ground tests, the space gun successfully pierced a metal canister of gasoline from a distance of 1.6 km.
However, the physics of space stations limited the capabilities of weapons. Although the astronauts could fire with the telescopic sight in the cockpit, they had to rotate the entire 20-ton station in order to direct the cannon to the target.
While the R-23M has been in development since the mid-1960s, the rest of the Almaz project was behind schedule.
The launch of NASA's Skylab spacecraft was scheduled for 1973, which meant the USSR could lose the race to put the first space station into orbit. Therefore, the Soviet government decided to build a small civilian outpost from the finished components of the Soyuz spacecraft and the existing Almaz equipment. The orbital station was successfully launched in 1971 under the name Salyut.
Having received political points for winning the space station race, the Kremlin allowed the Almaz project to continue, but to "disguise" it as civilian space stations. Until 1982, the USSR put into orbit a total of seven space stations called Salyut, but three of them were actually Almaz combat stations. Western intelligence services and independent observers quickly figured out what was what, but officially the Almaz program remained classified until the end of the Cold War.
Only after the collapse of the USSR did it become known from Russian sources that the cannon had actually fired in orbit. This happened on January 24, 1975 aboard the Salyut-3 space station.
Worried about how the firing from the giant cannon would affect the space warhead itself, Soviet specialists planned a test shot just hours before the station's planned deorbiting and long after the crew departed on July 19, 1974. The outpost fired its jet engines at the same time as the cannon fired to counteract the powerful recoil of the weapon. According to various sources, the cannon fired one to three rounds at a time, in total about 20 rounds were fired. They also burned up in the atmosphere.
The test results are still classified.