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).
Firearms include a variety of ranged weapons and there is no agreed upon definition. Many soldiers consider a firearm to be any ranged weapon that uses gunpowder or a derivative as a propellant.
The smallest of all firearms is the handgun. There are two common types of handguns: revolvers and semi-automatic pistols. Revolvers have a number of firing chambers or "charge holes" in a revolving cylinder; each chamber in the cylinder is loaded with a single cartridge or charge. Semi-automatic pistols have a single fixed firing chamber machined into the rear of the barrel, and a magazine so they can be used to fire more than one round. Each press of the trigger fires a cartridge, using the energy of the cartridge to activate the mechanism so that the next cartridge may be fired immediately. This is opposed to "double-action" revolvers which accomplish the same end using a mechanical action linked to the trigger pull.
Prior to the 19th century, virtually all handguns were single-shot muzzleloaders. With the invention of the revolver in 1818, handguns capable of holding multiple rounds became popular. Certain designs of auto-loading pistol appeared beginning in the 1870s and had largely supplanted revolvers in military applications by the end of World War I. By the end of the 20th century, most handguns carried regularly by military, police and civilians were semi-automatic, although revolvers were still widely used. Generally speaking, military and police forces use semi-automatic pistols due to their high magazine capacities and ability to rapidly reload by simply removing the empty magazine and inserting a loaded one. Revolvers are very common among handgun hunters because revolver cartridges are usually more powerful than similar caliber semi-automatic pistol cartridges (which are designed for self-defense) and the strength, simplicity and durability of the revolver design is well-suited to outdoor use. Revolvers, especially in .22 LR and 38 Special/357 Magnum, are also common concealed weapons in jurisdictions allowing this practice because their simple mechanics make them smaller than many autoloaders while remaining reliable. Both designs are common among civilian gun owners, depending on the owner's intention (self-defense, hunting, target shooting, competitions, collecting, etc.).
A long gun is generally any firearm that is larger than a handgun and is designed to be held and fired with both hands, either from the hip or the shoulder. Long guns typically have a barrel between 10 and 30 inches (there are restrictions on minimum barrel length in many jurisdictions; maximum barrel length is usually a matter of practicality), that along with the receiver and trigger group is mounted into a wood, plastic, metal or composite stock, composed of one or more pieces that form a foregrip, rear grip, and optionally (but typically) a shoulder mount called the butt. Early long arms, from the Renaissance up to the mid-19th century, were generally smoothbore firearms that fired one or more ball shot, called muskets.