Kalashnikov, hero and inventor, is dead, but how did he do it?

Mikhail Kalashnikov is dead. From the LA Times:

Weapons designer Mikhail Kalashnikov, […] The creator of the legendary AK-47, which became widely known as the Kalashnikov, […] died Monday […]

Over six decades, Kalashnikov’s cheap, simple and rugged creation became the weapon of choice for more than 50 standing armies as well as drug lords, street gangs, revolutionaries, terrorists, pirates and thugs the world over.

Here is a great piece by CJ Maloney celebrating the AK-47. What I really want to know is this: How was such an invention able to be created in the Soviet Union?

The only option I can think of is that the military-industrial complex of the USSR was so powerful and influential that incentives actually drove innovation in that sector of the economy.

But even this doesn’t fully explain how Kalashnikov was able to invent the gun, patent it, put his name on it, and reap the benefits from creating it in the first place. How could any of this be possible in a command-and-control economy?