A gun barrel is a part of firearms and artillery pieces. It is the straight shooting tube, usually made of rigid high-strength metal, through which a deflagration or rapid expansion of gases are released in order to propel a projectile out of the end at a high velocity. The hollow interior of the barrel is called the bore.
The first firearms were made at a time when metallurgy was not advanced enough to cast tubes able to withstand the explosive forces of early cannon, so the pipe (often built from staves of metal) needed to be braced periodically along its length, producing an appearance somewhat reminiscent of a storage barrel.
A gun barrel must be able to hold in the expanding gas produced by the propellants to ensure that optimum muzzle velocity is attained by the projectile as it is being pushed out by the expanding gas(es). Modern small arms barrels are made of materials known and tested to withstand the pressures involved. Artillery pieces are made by various techniques providing reliably sufficient strength.
Early firearms were muzzle-loading, with powder, and then shot loaded from the muzzle, capable of only a low rate of fire. Breech loading provided a higher rate of fire, but early breech-loading guns lacked an effective way of sealing the escaping gases that leaked from the back end of the barrel, reducing the available muzzle velocity. During the 19th century effective mechanical locks were invented that sealed a breech-loading weapon against the escape of propellant gases.
Gun barrels are usually metal. The early Chinese, the inventors of gunpowder, used bamboo, a naturally tubular stalk, as the first barrels in gunpowder projectile weapons. Early European guns were made of wrought iron, usually with several strengthening bands of the metal wrapped around circular wrought iron rings and then welded into a hollow cylinder. The Chinese were the first to master cast-iron cannon barrels. Bronze and brass were favoured by gunsmiths, largely because of their ease of casting and their resistance to the corrosive effects of the combustion of gunpowder or salt water when used on naval vessels.