The invention of the gun is attributed to multiple inventors and civilizations throughout history. The first known gun-like device, called a "fire lance," was invented in China during the 9th century. It consisted of a tube attached to a spear-like weapon that shot flames and shrapnel.