A firearm is a portable gun (a barreled ranged weapon) that inflicts damage on targets by launching one or more projectiles driven by rapidly expanding high-pressure gas produced by exothermic combustion (deflagration) of propellant within an ammunition cartridge. If gas pressurization is achieved through mechanical gas compression rather than through propellant combustion, then the gun is technically an air gun, not a firearm.
The first primitive firearms originated in 10th-century China when bamboo tubes containing gunpowder and pellet projectiles were mounted on spears into the one-person-portable fire lance,, which was later used as a shock weapon to good effect in the Siege of De’an. In 13th century, the Chinese invented the metal-barrelled hand cannon, widely considered to be the true ancestor of all firearms. The technology gradually spread through the rest of East Asia, South Asia, the Middle East, and Europe. Older firearms typically used black powder as a propellant, but modern firearms use smokeless powder or other propellants. Most modern firearms (with the notable exception of smoothbore shotguns) have rifled barrels to impart spin to the projectile for improved flight stability.
Modern firearms can be described by their caliber (i.e. their bore diameter; this is given in millimeters or inches e.g. 7.5 mm, .357 in.) or in the case of shotguns their gauge (e.g. 12 ga.); by the type of action employed (muzzle, breech, lever, bolt, pump, revolver, semi-automatic, automatic etc.) together with the usual means of deportment (hand-held or mechanical mounting). Further classification may make reference to the type of barrel used (rifled) and to the barrel length (24 inch), to the firing mechanism (e.g. matchlock, wheellock, flintlock, percussion lock), to the design’s primary intended use (e.g. hunting rifle), or to the commonly accepted name for a particular variation (e.g. Gatling gun).
Shooters aim firearms at their targets with hand-eye coordination, using either iron sights or optical sights. The accurate range of pistols generally does not exceed 110 yards (100 m), while most rifles are accurate to 550 yards (500 m) using iron sights, or to longer ranges using optical sights (firearm rounds may be dangerous or lethal well beyond their accurate range; the minimum distance for safety is much greater than specified range). Purpose-built sniper rifles and anti-materiel rifles are accurate to ranges of more than 2,200 yards (2,000 m).