The gun barrel probably evolved from the medieval petard. The petard was a bell-shaped metal device open at one end and filled with explosive material. It was placed with the open end touching the door or wall to be breeched. A fuse was lit and the main charge ignited. The shaped metal body of the petard concentrated the force of the explosion on a small area. The principle was a precursor of modern shaped-charge devices used to pierce armor plate.
Large petards were mounted to a framework to hold them against the door or wall. Smaller petards were mounted on long sticks, held by a combat engineer, and used to break smaller items, such as metal locks or door hinges. A hollow tube supported on a stick is similar to our example of a simple firearm. The large petards evolved into cannon and the smaller ones into hand-held firearms.