A bayonet (from French baïonnette) is a bladed weapon similar to a knife or short sword, or spike-shaped weapon designed to fit in, on, over or underneath the muzzle of a rifle, musket or similar firearm, augmenting the firearm to allow use as a pike. Starting in the 17th century, it was a weapon of primary importance for infantry attacks, even up to World War Two, but more a weapon of last resort since then. In this regard, it is an ancillary close-quarter combat weapon. When detached from the gun barrel, knife-like bayonets have long been utilized by soldiers in the field as a general-purpose tool. Some modern bayonets, such as the one used on the British SA80 assault rifle and the one used on the AK47, are designed to be wire cutters when combined with their scabbards.
The term bayonette dates back to the end of the 16th century, but it is not clear whether bayonets at the time were knives that could be fitted to the ends of firearms, or simply a type of knife. For example, Cotgrave's 1611 Dictionarie describes the Bayonet as "a kind of small flat pocket dagger, furnished with knives; or a great knife to hang at the girdle". Likewise, Pierre Borel wrote in 1655 that a kind of long-knife called a bayonette was made in Bayonne but does not give any further description.
The concept of the bayonet, which is essentially the idea of improvising a firearm as a pike, probably evolved from the early concept of spears having firearms being attached to them, also known as "Fire lances". Various forms of fire lances were recorded in the 14th century Chinese gunpowder military treatise Huolongjing including the Fire lance and the . These examples demonstrated a clear need for a form of hybrid weapon as such weapons only have a firing range of 3 meters or less, meaning reloading is almost impossible during an encounter with enemy forces and an immediate melee backup weapon is necessary. The first clearly recorded instance of a bayonet proper is found in the Chinese military treatise published in 1606, in the form of the , a breech-loading musket that was issued with a plug bayonet that was roughly 57.6 centimetres in length and have an overall length of 1.92 meters with the bayonet attached. It was labelled as a "gun-blade" with it being described as a "short sword that can be inserted into the barrel and secured by twisting it slightly" that it is to be used "when the battle have depleted both gunpowder and bullets as well as fighting against rebels/bandits, forces closing into melee or encountering an ambush" and if one "cannot load the gun within the time it takes to cover two bu (3.2 meters) of ground they are to attach the bayonet and hold it like a spear".