A bayonet (from French baïonnette) is a knife, dagger, sword, or spike-shaped weapon designed to fit on the end of the muzzle of a rifle, carbine, musket or similar firearm, allowing it to be used as a spear-like weapon.
From the early 17th to the early 20th century, it was a melee weapon used by infantry for offensive and/or defensive tactics. Today, it is considered an ancillary weapon or a weapon of last resort, although it is still used for ceremonial purposes.
The term bayonette itself dates back to 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. There are some accounts that place the invention of the bayonet in either France or Germany as early as 1570.
The first recorded instance of a bayonet proper is found in the Chinese military treatise, Binglu published in 1606. It was in the form of the Son-and-mother gun, a breech-loading musket that was issued with a roughly long plug bayonet, giving it an overall length of 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 bandits, when forces are 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".
Early bayonets were of the "plug" type, where the bayonet was fitted directly into the barrel of the musket. This allowed light infantry to be converted to heavy infantry and hold off cavalry charges.