<Tr> <Td> </Td> <Td> This article has an unclear citation style . The references used may be made clearer with a different or consistent style of citation and footnoting . (May 2015) (Learn how and when to remove this template message) </Td> </Tr> <P> After the Chinese invented black powder during the 9th century, these inventions were later transmitted to the Middle East, Africa, and Europe . The direct ancestor of the firearm is the fire lance . The prototype of the fire lance was invented in China during the 10th century and is the predecessor of all firearms . </P> <P> The direct ancestor of the firearm is the fire lance, a black - powder--filled tube attached to the end of a spear and used as a flamethrower (not to be confused with the Byzantine flamethrower); shrapnel was sometimes placed in the barrel so that it would fly out together with the flames . The earliest known depiction of a gunpowder weapon is the illustration of a fire - lance on a mid-10th century silk banner from Dunhuang . The De'an Shoucheng Lu, an account of the siege of De'an in 1132 during the Jin--Song Wars, records that Song forces used fire - lances against the Jurchen . </P> <P> The proportion of saltpeter in the propellant was increased to maximize its explosive power . To better withstand that explosive power, the paper, and bamboo of which fire - lance barrels were originally made came to be replaced with metal . And to take full advantage of that power, the shrapnel came to be replaced by projectiles whose size and shape filled the barrel more closely . With this, the three basic features of the gun emerged: a barrel made of metal, high - nitrate gunpowder, and a projectile which totally occludes the muzzle so that the powder charge exerts its full potential in propellant effect . </P>

When was the gun first used in war
find me the text answering this question