A firearm is a device that can be used as a weapon that fires either single or multiple projectiles propelled at high velocity by the gases produced through rapid, confined burning of a propellant. This process of rapid burning is technically known as deflagration. In older firearms, this propellant was typically black powder, but modern firearms use smokeless powder, cordite, 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.
Guns are distinct from howitzers and mortars, which have lower muzzle velocities and, typically, higher trajectories. Hand-held firearms, like rifles, carbines, pistols and other small firearms are rarely called "guns" in the restricted sense among specialists. Machine guns fire small caliber ammunition (generally 14.5mm or smaller), and many machine guns are crew served firearms, requiring the services of more than one crewman, just like artillery guns. Generally, an automatic firearm designed for a single user is referred to as an automatic rifle. However, many regulatory agencies, such as the American US BATFE, consider any firearm which dispenses more than one round with a single manipulation of the firing device to be a "machine gun" for regulatory purposes. Other terms, including "firearm" itself, have been defined in specialized ad hoc ways by various legislation.
In recent centuries, firearms have become the predominant weapons used by mankind. Modern warfare since the late Renaissance has relied upon firearms, with wide-ranging effects on military history and history in general. This created a whole new kind of battle, which molded modern-era armies.
For handguns and long guns, the projectile is a bullet, or in historical cannons, a cannonball. The projectile is fired by the burning of the propellant, but in small arms rarely contains explosives itself. The use of expanding (e.g. hollow-point) small-arms ammunition in warfare is banned by the Hague Convention. For modern artillery the projectile is a shell, which almost always contains explosives.
Until the mid-1800s, projectiles and propellant (black powder at the time) were generally separate components used in a muzzle-loading firearm such as a musket, pistol, or cannon. Sometimes for convenience a suitable amount of powder and a bullet were wrapped in a paper package, known as a cartridge. This evolved into the form of a tubular metal casing enclosing a primary igniter (primer) and the powder charge, with the projectile press-fit into the end of the casing opposite the primer. Cartridge ammunition was widely adopted, and as of the first World War it had become the primary form of ammunition for small arms, tanks, and artillery. Mortars use a similar concept of encapsulation; however the projectile and casing are generally a single piece that is launched from the firearm. Some short-range naval guns use cased ammunition, but many battleship and cruiser main guns use a shell and separate bagged powder measures, which are selected according to the desired ballistic path.
A distinction is sometimes made between the projectile itself as the weapon and the firearm as a weapons platform. In some cases, the firearm can be used directly as a weapon without firing a projectile, although this is virtually always a secondary method of attack used in close combat. For example, arms such as rifles, muskets, and occasionally submachine guns can have bayonets affixed to them, becoming in effect a spear or pike. With some notable exceptions, the stock of a long gun can be used as a club. It is also possible to strike someone with the barrel of a firearm or grasp it by the barrel or grip and strike someone with the butt, which is informally called "pistol-whipping".
A problem for firearms is the accumulation of waste products from the partial combustion of propellants, metallic residue from the bullet itself, and small flecks of the cartridge case, known as fouling or gunshot residue. These waste products can interfere with the internal functions of the firearm. As a result, regularly used firearms must be periodically partially disassembled, cleaned and lubricated to ensure the firearm’s reliability.
Firearms may sometimes be referred to as small arms. Small arms are firearms which can be carried by a single individual. According to international conventions governing the Laws of War, small arms are defined (with some exceptions) as firearms which fire a projectile not in excess of 15 mm (0.60 inches) in diameter. Small arms are aimed visually at their targets by hand using optical sights. The range of accuracy for small arms is generally limited to about one mile (1600 m), usually considerably less, although the current record for a successful sniper attack is slightly more than 1.5 miles (2.4 km). Artillery guns are much larger than these firearms, mounted on a movable carriage, having bores of up to 18 inches (46 cm) and possibly weighing many tons. Artillery can be accurate at ranges of up to about 26 miles (42 km) and, with some notable exceptions (ex. tank guns), are aimed using altitude/azimuth settings. Strictly speaking, such weapons are not firearms.
The direct ancestor of the firearm is the fire-lance, a gunpowder-filled tube attached to the end of a spear and used as a flamethrower; shrapnel was sometimes placed in the barrel so that it would fly out together with the flames. The fire-lance had developed into the gun by the 1100s, the date of the earliest known depiction of a gun, a sculpture from a cave in Sichuan. The earliest European documentation of the gun is Walter de Milemete's De Nobilitatibus, Sapientiis, et Prudentiis Regum from 1326. The earliest Islamic documentation of gunpowder is from the work of the 13th century scientist Hasan al-Rammah. Gunpowder arrived in India by the mid-1300s, but could have been introduced by the Mongols perhaps as early as the mid-1200s.
The Arabic engineer and chemist Hasan al-Rammah, in The Book of Military Horsemanship and Ingenious War Devices, described the earliest known recipes for an explosive gunpowder effect, some of which were almost identical to the ideal composition for explosive gunpowder used in modern times (75% saltpetre (KNO3), 10% sulfur, 15% carbon), such as the tayyar "rocket" (75 parts saltpetre, 8 sulfur, and 15 carbon, by weight) and the tayyar buruq "lightning rocket" (74 parts saltpetre, 10 sulfur, 15 carbon). He states in his book that many of these recipes were known to his father and grandfather, hence dating back to at least the late 12th century. The earliest known military applications of these explosive gunpowder compositions were the explosive hand cannons first used by the Egyptians to repel the Mongols at the Battle of Ain Jalut in 1260.
The invention of torpedoes also occurred in the Muslim world, and were driven by a rocket system. The works of Hasan al-Rammah in Syria in 1275 shows illustrations of a torpedo running on water with a rocket system filled with explosive materials and having three firing points. The first supergun was the Great Turkish Bombard, used by the troops of Mehmed II to capture Constantinople in 1453. It had a 762 mm bore, and fired 680 kg (1500 lb) stones.
By the 13th century, explosive projectiles were being used by the Mongols in their invasions of Japan. A set of scrolls commissioned by Takezaki Suenaga, a Japanese warrior who fought against the Mongols, depict the Mongol’s use of an exploding shell, known as a teppo. In addition, several more explosive shells have been discovered off the coast of Japan where several ships of the Mongol fleet sank during their second invasion.
While firearms were beginning to form throughout Southeast Asia, the spread of gunpowder and its uses in weaponry also came to Portugal and Morocco. In 1415, the Portuguese invaded the Mediterranean port town of Ceuta. While it is difficult to confirm the use of firearms in the siege of the city, it is known that the Portuguese defended it thereafter with firearms, namely bombardas, colebratas, and falconetes. In 1419, Sultan Abu Sa’id led an army to reconquer the fallen city, and Moroccans brought cannons and used them in the assault on Ceuta. Finally, hand-held firearms and riflemen appear in Morocco, in 1437, in an expedition against the people of Tangiers. It is clear that these weapons had developed into several different forms, from small guns to large artillery units.
The artillery revolution in Europe caught on during the Hundred Years War and changed the way that battles were fought. In the following year, the English used a gunpowder weapon in a military campaign against the Scottish. However, at this time, the cannons used in battle were very small and not particularly powerful. Cannons were only useful for the defense of a castle, as demonstrated in the battle of Breteuil in 1356, when the besieged English used a cannon to destroy an attacking French assault tower. By the end of the 14th century, cannons were only powerful enough to knock in roofs, and therefore could not penetrate castle walls. However, a major change occurred between 1420-1430, when artillery became much more powerful and could now batter strongholds and fortresses quite efficiently. Both the English, French, and Burgundians advanced in military technology, and as a result the traditional advantage that went to the defense in a siege was lost. The cannons during this period were elongated, and the recipe for gunpowder was improved to make it three times as powerful as before. These changes led to the increased power in the artillery weapons of the time.
During the Hundred Years War, Joan of Arc encountered gunpowder weaponry several times. When she led the French against the English at the Battle of Tourelles, in 1429, she faced heavy gunpowder fortifications, and yet her troops prevailed in that battle. In addition, she led assaults against the English-held towns of Jargeau, Meung, and Beaugency, all with the support of large artillery units. When she led the assault on Paris, Joan faced stiff artillery fire, especially from the suburb of St. Denis, which ultimately led to her defeat in this battle. In April 1430, she went to battle against the Burgundians, whose support was purchased by the English. At this time, the Burgundians had the strongest and largest gunpowder arsenal among the European powers, and yet the French, under Joan of Arc’s leadership, were able to beat back the Burgundians and defend themselves. As a result, most of the battles of the Hundred Years War that Joan of Arc participated in were fought with gunpowder artillery.
Gunpowder use in artillery had spread as far as Europe by 1500. Cannons as well as small firearms were being used by this time, and as a result warfare changed dramatically during this period. Gunpowder weapons now had widespread use in battle from this point on.
 Small arms
The smallest of all small arms is the handgun (or pistol). There are three common types of handguns: single-shot pistols (more common historically), 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. Semi-automatic pistols have a single fixed firing chamber machined into the rear of the barrel, and a removable magazine so they can be used to fire more than one round. The Italian-made Mateba revolver is a rare "hybrid," a semi-automatic revolver. Each press of the trigger fires a cartridge and rotates the cylinder so that the next cartridge may be fired immediately. The British firearms firm Webley also made an "automatic revolver" around the turn of the 20th century.
Handguns differ from rifles and shotguns in that they are smaller, lack a shoulder stock (though some pistols like the Luger and Browning Hi-Power accept a removable stock allowing its use as a carbine), are usually chambered for less-powerful cartridges, and are designed to be fired with one or two hands. While the term "pistol" can be properly used to describe any handgun, it is common to refer to a single-shot or auto-loading handgun as a "pistol" and a revolver as a "revolver".
The term "automatic pistol" is sometimes used and is somewhat misleading in that the term 'automatic' does not refer to the firing mechanism, but rather the reloading mechanism. When fired, an automatic pistol uses recoil and/or propellant gases to automatically extract the spent cartridge and insert a fresh one from a magazine. Usually (but not always) the firing mechanism is automatically cocked as well. An automatic pistol fires one shot per trigger pull, unlike an automatic firearm such as a machine gun, which fires as long as the trigger is held down and there are unspent cartridges in the chamber or magazine. There are, however, some fully automatic handguns (often referred to as machine pistols) so, to avoid such ambiguity and confusion, either "semi-automatic" or "autoloader" is preferred when referring to a firearm that fires only one shot per trigger pull.
Prior to the 19th century, 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 WWI. 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 (10 to 17 or, in some cases, over 25 rounds of ammunition) 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. Both designs are common among civilian gun owners, depending on the owner's intention (self-defense, hunting, target shooting, competitions, collecting, etc).
Handguns come in many shapes and sizes. For example, the "derringer" (a generic term based on the mid-19th century "Deringer" brand name) is a very small, short-barreled handgun, usually with one or two barrels but sometimes more (some 19th century derringers had four barrels) that have to be manually reloaded after being fired. Carefully matched single-shot duelling pistols were used primarily in the 18th and 19th centuries to settle serious differences among "gentlemen": Alexander Hamilton and Aaron Burr are probably the most prominent Americans who used duelling pistols to settle their differences. Revolvers and auto-loading pistols are produced in a wide variety of sizes, with autoloaders generally categorized as one of four sizes: full-size, compact, sub-compact and ultra-compact. Each size has merits and shortcomings; a smaller handgun usually sacrifices ammunition capacity, recoil damping and/or long-range accuracy for increased concealability and ease of use by smaller-framed shooters. Fully automatic, relatively easily concealed machine pistols, such as the MAC-10, Glock 18, and the Beretta 93R, were a late 20th century development.
Handguns are small and usually made to be carried in a holster, thus leaving both hands free. Small handguns can be easily concealed, thus making them a very common choice for personal protection. In the military, handguns are usually issued to those who are not expected to need more potent firearms, such as general and staff officers, and to those for whom there is no room for a full-sized rifle, such as vehicle crews. In this last role, they often compete with the carbine, a short, light rifle, which is also usually issued to airborne infantry because of its small size. Handguns were historically issued to riflemen as a secondary weapon, however the reliability and firepower of the modern assault rifle (and the increasing amount and cost of equipment carried by a soldier) has made this practice less common as of the end of the 20th century. Outside the military, handguns are the usual armament for police and, where legal, for private citizens.
Private citizens in most jurisdictions usually carry only concealed handguns in public except when hunting, since an unconcealed firearm would attract undue attention, and would therefore be less secure, although there are significant numbers of states in the US that permit open carry of handguns, sometimes subject to licensing or restrictions. In the United States, the number of states which permit concealed carry has recently grown to over 35, and several states have well over 200,000 permit holders. Despite Second Amendment constitutional roots in the United States, the concept of citizens carrying a concealed firearm for self-defense is often a contentious political issue; see gun politics for more information.
Handguns are also used for many sporting purposes and hunting, although hunting usage is usually viewed as somewhat atypical due to the limited range and accuracy of handguns. Some hunters, however, do their hunting in areas of dense cover where long guns would be awkward, or they relish the increased challenge involved in handgun hunting due to the necessity of approaching the game animal more closely. Handgun ammunition is also generally less expensive than rifle cartridges, and is usually sufficient for many larger pest animals such as feral hogs, coyotes and wolves. Small-bore (e.g. .22 caliber rimfire) handguns have long been very popular for competitive target shooting, partially due to the low cost of both the firearms and the ammunition, and there is also a rapidly growing number of sporting competitions for larger calibers, including "practical shooting", the guidelines of which usually require a handgun of caliber 9x19mm or greater.
 Long guns
Most modern long guns are either rifles or shotguns. Historically, a long smoothbore firearm was known as a musket. A rifle has a rifled barrel that fires single bullets, while a shotgun fires packets of shot, a single slug, a sabot, or a specialty round (such as tear gas, bolo shell, or a breaching round). Rifles have a very small impact area but a long range and high accuracy. Shotguns have a large impact area with considerably less range and accuracy. However, the larger impact area can compensate for reduced accuracy, since shot spreads during flight; consequently, in hunting, shotguns are used for flying game.
Rifles and shotguns are commonly used for hunting and often to defend a home or place of business. Usually, large game are hunted with rifles (although shotguns can be used), while birds are hunted with shotguns. Shotguns are sometimes preferred for defending a home or business due to their wide impact area, multiple wound tracks (when using buckshot), shorter range, and reduced penetration of walls, which significantly reduces the likelihood of unintended harm, although the handgun is also common.
There are a variety of types of rifles and shotguns based on the method they are reloaded. Bolt-action and lever-action rifles are manually operated. Manipulation of the bolt or the lever causes the spent cartridge to be removed, the firing mechanism recocked, and a fresh cartridge inserted. These two types of action are almost exclusively used by rifles. Slide-action (commonly called 'pump-action') rifles and shotguns are manually cycled by shuttling the foregrip of the firearm back and forth. This type of action is typically used by shotguns, but several major manufacturers make rifles that use this action.
Both rifles and shotguns also come in break-action varieties that do not have any kind of reloading mechanism at all but must be hand-loaded after each shot. Both rifles and shotguns come in single- and double-barreled varieties; however due to the expense and difficulty of manufacturing, double-barreled rifles are rare. Double-barreled rifles are typically intended for African big-game hunts where the animals are dangerous, ranges are short, and speed is of the essence. Very large and powerful calibers are normal for these firearms.
Rifles have been in nationally featured marksmanship events in Europe and the United States since at least the 18th century, when rifles were first becoming widely available. One of the earliest purely "American" rifle-shooting competitions took place in 1775, when Daniel Morgan was recruiting sharpshooters in Virginia for the impending American War of Independence. In some countries, rifle marksmanship is still a matter of national pride. Some specialized rifles in the larger calibers are claimed to have an accurate range of up to about one mile (1600 m), although most have considerably less. In the second half of the 20th century, competitive shotgun sports became perhaps even more popular than riflery, largely due to the motion and immediate feedback in activities such as skeet, trap and sporting clays.
In military use, bolt-action rifles with high-power scopes are common as sniper rifles, however by the Korean War the traditional bolt-action and semi-automatic rifles used by infantrymen had been supplanted by select-fire designs known as "automatic rifles" (see "Automatic Rifle" in the next section)
 Automatic weapons
An automatic weapon is a firearm capable of firing multiple rounds with one pull of the trigger. The Gatling gun was an early crank-operated weapon that may have been the first automatic weapon, though the modern trigger-actuated machine gun was not widely introduced until the First World War with the German "Spandau" and British Lewis gun. Automatic weapons are largely restricted to military and paramilitary organizations, though many automatic designs are infamous for their use by organized crime.
Automatic firearms have long been available to US civilians, under increasingly restrictive conditions. Importation of machine guns for civilian sale in the US was banned by the Gun Control Act of 1968. The Hughes Amendment to the Firearm Owners Protection Act now prohibits US civilian ownership or transfer of automatic weapons unless they were registered before 1986-05-19. Non-prohibited automatic weapons can be legally transferred to civilians who pay a substantial tax to the BATFE and pass a background investigation, although permission must be received from BATFE to move a machine gun between states. An extremely limited number of US citizens have special permits from the BATFE to buy, and even import, automatic weapons produced and registered after 1986. The use of such weapons is tightly restricted to the film industry under direct supervision of the master of arms holding the permit, and the weapons are often altered so they will not fire "factory" ammunition, but rather only special "light-primer" blank cartridges produced specifically for the film industry. This arrangement allows weapons first produced after 1986 to be used by actors in films and TV series filmed inside the US.
 Machine gun
A machine gun is a fully automatic emplaceable weapon, generally separated from other classes of automatic weapon by the use of belt-fed ammunition (though some designs employ drum, pan or hopper magazines), generally in a rifle-inspired caliber ranging between 5.56mm NATO to as large as .50BMG or larger for crewed or aircraft weapons. Although not widely fielded until World War I, early machine guns were being used by the military in the second half of the 19th century. They were primarily defensive firearms crewed by two men, mainly because of the difficulties involved in moving and placing them, and their inherent lack of accuracy. In contrast, light machine guns (such as the FN Minimi and the M60 machine gun, both of which are small-caliber firearms) are often wielded by a single infantryman; they provide a high rate of fire, generally of a higher-power round than the infantryman's assault rifle, and are typically used to give suppressing fire during infantry movement. Machine guns are also often mounted on vehicles or helicopters, and have often been used since World War I as offensive firearms in fighter aircraft and tanks (e.g., for air combat or suppressing fire for ground troop support).
The definition of machine gun is different in US law. The National Firearms Act and Firearm Owners Protection Act define a "machine gun" in the United States code Title 26, Subtitle E, Chapter 53, Subchapter B, Part 1, § 5845 as: "... any firearm which shoots ... automatically more than one shot, without manual reloading, by a single function of the trigger". "Machine gun" is therefore largely synonymous with "automatic weapon" in the US civilian parlance, covering all automatic firearms.
 Gatling gun
A Gatling gun is a type of machine gun distinguished by the use of multiple rotating barrels. It is actually one of the first belt-fed automatic designs, being originally mounted on a cannon chassis and operated by a crank. With the advent of the simpler, more compact single-barrel machine gun the Gatling gun faded from use, however it regained popularity as of the Vietnam War as an armament for fighters and helicopters, as its configuration lowers the rate of fire per barrel and also cools the barrels as they rotate, allowing for a very high rate of fire without barrel overheating. Modern Gatling designs are generally operated using hydraulics or electric motors. The most common gatling design in the US arsenal is the M61 Vulcan cannon used on a variety of US and NATO fighters. Personal-sized designs such as the Minigun exist and feature in several action movies including Terminator 2 and Predator, but in reality they are virtually never seen as unmounted personal weapons, the high rate of fire (with accompanying recoil), mechanical complexity and heavy weight making them impractical compared to a light machine gun.
 Submachine gun
A submachine gun is a magazine-fed firearm, usually smaller than other automatic firearms, that fires pistol-caliber cartridges; for this reason submachine guns are also commonly called machine pistols especially when referring to handgun-sized designs such as the MAC-10 and Glock 18. Well-known examples are the Israeli Uzi, the British Sten, and the German H&K MP5, all of which use the 9 mm Parabellum, the US's Thompson submachine gun which fires .45 ACP, and the Belgian FN P90 PDW which fires a 5.7x28mm cartridge. Because of their small size and limited projectile penetration compared to high-power rifle rounds, submachine guns are commonly favored by military, paramilitary and police forces for close-quarters use such as inside buildings, in urban areas or in trench complexes.
 Automatic rifle
An automatic rifle is a magazine-fed long gun, wielded by a single infantryman, that is chambered for rifle cartridges and capable of automatic fire. The Browning Automatic Rifle was the first US infantry weapon of this type, and was generally used for suppressive or support fire. In answer, the German forces fielded the Sturmgewehr 44 during WWII, a light automatic rifle firing a reduced power "intermediate cartridge". This design was to become the model for the "assault rifle" subclass of automatic weapons. After WWII, the M14 (a gas-actuated select-fire design that replaced the M1 Garand) was introduced in the US, followed by the M16A1 assault rifle which was widely used in the Vietnam War. Also soon after WWII, the Automat Kalashnikov AK-47 assault rifle was fielded by the USSR and other Communist allies including the Eastern Bloc, China, North Korea, and North Vietnam. Variants of both of the M16 and AK-47 are still in wide international use today, though other automatic rifle designs have since been introduced. A smaller version of the M16A2, the M4 carbine, is widely used by tank and vehicle crews, support staff, and in other scenarios where space is limited. The IMI Galil, an Israeli-designed weapon similar to the AK-47, is in use by Israel, Italy, Myanmar, the Philippines, Peru, and Columbia. Swiss Arms AG of Switzerland produces the Sig 550 assault rifle used by France, Chile, and Spain among others, and Steyr Mannlicher produces the AUG, a bullpup rifle in use in Austria, Australia, New Zealand, Ireland and Saudi Arabia among other nations.
 Loading and firing mechanisms
 Muzzle-loaded Cannon
The cannon is loaded with gunpowder and the cannonball through the muzzle, while a fuse is placed at the rear. This fuse is lighted, causing the gunpowder to ignite and propel the cannonball. Most cannons were land- or ship-based guns, although hand cannons also existed. In military use, the standard cannon was tremendously powerful, while hand cannon was somewhat useless. In the 19th century, the muzzle-loaded cannon was made obsolete by the breech-loaded artillery piece with a rifled barrel.
Muzzle-loading muskets (smooth-bored long guns) were among the first small arms developed. The firearm was loaded through the muzzle with gunpowder, optionally some wadding and then a bullet (usually a solid lead ball, but musketeers could shoot stones when they ran out of bullets). Greatly improved muzzleloaders (usually rifled instead of smooth-bored) are manufactured today and have many enthusiasts, many of whom hunt large and small game with their guns. Muzzleloaders have to be manually reloaded after each shot; a skilled archer could fire multiple arrows faster than most early muskets could be reloaded and fired, although by the mid-18th century, when muzzleloaders became the standard small armament of the military, a well-drilled soldier could fire six rounds in a minute using prepared cartridges in his musket. Before then, effectiveness of muzzleloaders was hindered by both the low reloading speed and, before the firing mechanism was perfected, the very high risk posed by the firearm to the person attempting to fire it.
One interesting solution to the reloading problem was the "Roman Candle Gun". This was a muzzleloader in which multiple charges and balls were loaded one on top of the other, with a small hole in each ball to allow the subsequent charge to be ignited after the one ahead of it was ignited. It was neither a very reliable nor popular firearm, but it enabled a form of "automatic" fire long before the advent of the machine gun.
Matchlocks were the first and simplest small arms firing mechanisms developed. Using the matchlock mechanism, the powder in the gun barrel was ignited by a piece of burning cord called a "match". The match was wedged into one end of an S-shaped piece of steel. As the trigger (often actually a lever) was pulled, the match was brought into the open end of a "touch hole" at the base of the gun barrel, which contained a very small quantity of gunpowder, igniting the main charge of gunpowder in the gun barrel. The match usually had to be relit after each firing.
The wheellock action, a successor to the matchlock, predated the flintlock. Despite its many faults, the wheellock was a significant improvement over the matchlock in terms of both convenience and safety, since it eliminated the need to keep a smoldering match in proximity to loose gunpowder. It operated using a small wheel much like that on cigarette lighters which was wound up with a key before use and which, when the trigger was pulled, spun against a flint, creating the shower of sparks that ignited the powder in the touch hole. Supposedly invented by Leonardo da Vinci, the Italian Renaissance man, the wheel lock action was an innovation that was not widely adopted.
The flintlock action was a major innovation in small arms design. The spark used to ignite the gunpowder in the touch hole was supplied by a sharpened piece of flint clamped in the jaws of a "cock" which, when released by the trigger, struck a piece of steel called the "frizzen" to create the necessary sparks. (The spring loaded arm that holds a piece of flint or pyrite is referred to as a cock because of its resemblance to a rooster.) The cock had to be manually reset after each firing, and the flint had to be replaced periodically due to wear from striking the frizzen. (See also flintlock mechanism, snaphance, miquelet) The flintlock was widely used during the 18th and 19th centuries in both muskets and rifles.
 Percussion cap
Percussion caps (caplock mechanisms), coming into wide service in the 19th century, were a dramatic improvement over flintlocks. With the percussion cap mechanism, the small primer charge of gunpowder used in all preceding small arms was replaced by a completely self-contained explosive charge contained in a small brass "cap". The cap was fastened to the touch hole of the gun (extended to form a "nipple") and ignited by the impact of the gun's "hammer". (The hammer is roughly the same as the cock found on flintlocks except that it doesn't clamp onto anything.) In the case of percussion caps the hammer was hollow on the end to fit around the cap in order to keep the cap from fragmenting and injuring the shooter.
Once struck, the flame from the cap in turn ignited the main charge of gunpowder, as with the flintlock, but there was no longer any need to charge the touch hole with gunpowder, and even better, the touch hole was no longer exposed to the elements. As a result, the percussion cap mechanism was considerably safer, far more weatherproof, and vastly more reliable (cloth-bound cartridges containing a premeasured charge of gunpowder and a ball had been in regular military service for many years, but the exposed gunpowder in the entry to the touch hole had long been a source of misfires). All muzzleloaders manufactured since the second half of the 19th century use percussion caps except those built as replicas of the flintlock or earlier small arms.
A major innovation in small arms and light artillery came in the second half of the 19th century when ammunition, previously delivered as separate bullets and powder, was combined in a single metallic (usually brass) cartridge containing a percussion cap, powder, and a bullet in one weatherproof package. The main technical advantage of the brass cartridge case was the effective and reliable sealing of high pressure gasses at the breech, as the gas pressure forces the cartridge case to expand outward, pressing it firmly against the inside of the gun barrel chamber. This prevents the leakage of hot gas which could injure the shooter. The brass cartridge also opened the way for modern repeating arms, by uniting the bullet, gunpowder and primer into one assembly.
Before this, a "cartridge" was simply a premeasured quantity of gunpowder together with a ball in a small cloth bag (or rolled paper cylinder), which also acted as wadding for the charge and ball. This early form of cartridge had to be rammed into the muzzleloader's barrel, and either a small charge of gunpowder in the touch hole or an external percussion cap mounted on the touch hole ignited the gunpowder in the cartridge. Cartridges with built-in percussion caps (called "primers") continue to this day to be the standard in firearms. In cartridge-firing firearms, a hammer (or a firing pin struck by the hammer) strikes the cartridge primer, which then ignites the gunpowder within. The primer charge is at the base of the cartridge, either within the rim (a "rimfire" cartridge) or in a small percussion cap embedded in the center of the base (a "centerfire" cartridge). As a rule, centerfire cartridges are more powerful than rimfire cartridges, operating at considerably higher pressures than rimfire cartridges.
Nearly all contemporary firearms load cartridges directly into their breech. Some additionally or exclusively load from a magazine that holds multiple cartridges. A magazine is usually a box or cylinder that is designed to be reusable and is detachable from the gun. Some magazines, such as those of the M1 Garand rifle, are internal to the firearm, and are loaded by using a clip, which is a device that looks like a rail holding the ammunition by the rim of the case. In most cases, a magazine and a clip are different in that the former's function is to feed ammunition into the firearm's breech, while the latter's is to refill a magazine with fresh ammunition.
 Repeating, semiautomatic, and automatic firearms
Many small arms are "single shot" firearms: i.e., each time a cartridge is fired, the operator must manually re-cock the firearm and load another cartridge. The classic single-barreled shotgun is a good example. A firearm that can load multiple cartridges as the firearm is re-cocked is considered a "repeating firearm" or simply a "repeater". A lever-action rifle, a pump-action shotgun, and most bolt-action rifles are good examples of repeating firearms. A firearm that automatically re-cocks and reloads the next round with each trigger pull is considered a semi-automatic firearm. An automatic (or "fully automatic") firearm is one that automatically re-cocks, reloads, and fires as long as the trigger is depressed. Many modern military firearms have a selective-fire option, which is a mechanical switch that allows the firearm be fired either in the semi-automatic or fully automatic mode. In the current M16A2 and M16A4 variants of the US-made M16, continuous fully automatic fire is not possible, having been replaced by an automatic burst of three cartridges.
The first "rapid firing" firearms were usually similar to the 19th century Gatling gun, which would fire cartridges from a magazine as fast as and as long as the operator turned a crank. Eventually, the "rapid" firing mechanism was perfected and miniaturized to the extent that either the recoil of the firearm or the gas pressure from firing could be used to operate it (which made the firing mechanisms truly "automatic"). Automatic rifles such as the Browning Automatic Rifle were in common use by the military during the early part of the 20th century, and automatic rifles that fired handgun rounds, known as submachine guns, also appeared in this time.
Submachine guns were originally about the size of carbines. Because they fire pistol ammunition, they have limited long-range use, but in close combat can be used in fully automatic in a controllable manner due to the light recoil of the pistol ammunition. They are also extremely inexpensive and simple to build in time of war, enabling a nation to quickly arm its military. In the latter half of the 20th century, submachine guns were being miniaturized to the point of being only slightly larger than some large handguns. The most widely used submachine gun at the end of the 20th century was the Heckler & Koch MP5. The MP5 is actually designated as a "machine pistol" by Heckler & Koch (MP5 stands for Maschinenpistole 5, or Machine Pistol 5), although some reserve this designation for even smaller submachine guns such as the MAC-10, which are about the size and shape of pistols.
Nazi Germany brought the world's attention to what eventually became the class of firearm most widely adopted by the military: the assault rifle (see Sturmgewehr 44). An assault rifle is usually slightly smaller than a military rifle such as the K98k. Generally, assault rifles have mechanisms that allow the user to select between single shots, fully automatic bursts, or fully automatic fire. Universally, civilian versions of military assault rifles are strictly semiautomatic.
The cartridge fired by these rifles is midway in power between a pistol cartridge and a high-power rifle round, which gives the soldier the close-in burst ability of a submachine gun with the more precision long-range shooting of a high-power rifle round. Soviet engineer Mikhail Kalashnikov quickly adapted the concept to the AK-47, which has become the world's most widely used assault rifle. In United States, John Garand, adapted the assault rifle design to produce the M14, which was used by the US military until the 1960s. The significant recoil of the M14 when fired in full automatic mode was seen as a problem as it reduced accuracy, and in the 1960s it was replaced by Eugene Stoner's AR-15, which also marked a switch from the high-powered but heavy .30-caliber rifle used by the US military since before World War I to the much smaller but far lighter and light recoiling .223-caliber rifle. The military later designated the AR-15 to the "M16". The civilian version of the M16 continues to be known as the AR-15 and looks exactly like the military version, although it lacks the mechanism that permits fully automatic fire.
Modern designs call for compact weapons retaining firepower. The bullpup design, by mounting the magazine behind the trigger, unifies the accuracy and firepower of the traditional assault rifle with the compact size of the submachine gun (though submachine guns are still used); examples are the French FAMAS or the British SA80.
Recently, smaller but powerful ammunition types have been introduced, as to allow personal defence weapons to penetrate ballistic armour. Such designs are the basis for the FN P90 and Heckler & Koch MP7. Caseless ammunition is another trend, (an example is the German Heckler & Koch G11). The flechette is yet another improvement over traditional ammunition, allowing for extreme penetration abilities and a very flat trajectory.
 See also
- Gun technology and science
- Electrothermal-chemical technology
- Firearm action
- Physics of firearms
- Rheological fluids based firearms mechanisms
- Terminal ballistics
- Guns and society
- Gun law
- Gun politics
- Gun safety
- Concealed carry
- List of United States firearms topics
- Small arms proliferation
- Gun-related terminology
- Types of firearms
- List of firearms
- List of pistols
- List of submachine guns
- List of assault rifles
- List of shotguns
- List of sniper rifles
- WW II Era firearms
- ^ Khan, Iqtidar Alam (1996), "Coming of Gunpowder to the Islamic World and North India: Spotlight on the Role of the Mongols", Journal of Asian History 30: 41–5.
- Ahmad Y Hassan, Gunpowder Composition for Rockets and Cannon in Arabic Military Treatises In Thirteenth and Fourteenth Centuries, History of Science and Technology in Islam.
- Ahmad Y Hassan, Technology Transfer in the Chemical Industries, History of Science and Technology in Islam.
- Arslan Terzioglu (2007), "The First Attempts of Flight, Automatic Machines, Submarines and Rocket Technology in Turkish History", in The Turks (ed. H. C. Guzel), pp. 804-810.
- Conlan, T: Scrolls of the Mongol Invasion of Japan
- Cook, W: Warfare and Firearms in Fifteenth Century Morocco, 1400-1492. 1993
- Rogers, C: The Military Revolutions of the Hundred Years War. 1993
- DeVries, K: The Use of Gunpowder Weaponry By and Against Joan or Arc During the Hundred Years War. 1996
- Roman Candle Gun at Scotwars.com
- Buchanan, Brenda J (2006), Gunpowder, Explosives and the State: A Technological History, Ashgate
- Chase, Kenneth (2003), Firearms: A Global History to 1700, Cambridge University Press, ISBN 0521822742
- Conlan, Thomas D, Scrolls of the Mongol Invasion of Japan
- Cook Jr, Weston F (1993), "Warfare and Firearms in Fifteenth Century Morocco, 1400-1492", War and Society V:11 (Issue:2)
- Crosby, Alfred W. (2002), Throwing Fire: Projectile Technology Through History, Cambridge University Press, ISBN 0521791588
- DeVries, Kelly (1996), "The Use of Gunpowder Weaponry By and Against Joan or Arc During the Hundred Years War", War and Society V:14 (Issue:1)
- Needham, Joseph (1986), Science & Civilisation in China, vol. V:7: The Gunpowder Epic, Cambridge University Press, ISBN 0521303583
- Rogers, Clifford J (1993), "The Military Revolutions of the Hundred Years War", The Journal of Military History V:57