A bayonet is a long, pointed weapon that can be attached to the end of a gun or rifle. It was originally used for close combat and as a tool for defense during sieges in medieval times. Today, it refers more broadly to any device that can be attached to a firearm to enable it to function as a spear or pike.