A duel is an arranged engagement in combat between two people, with matched weapons, in accordance with agreed-upon rules.
During the 17th and 18th centuries (and earlier), duels were mostly fought with swords (the rapier, and later the small sword), but beginning in the late 18th century in England, duels were more commonly fought using pistols. Fencing and pistol duels continued to co-exist throughout the 19th century.
The duel was based on a code of honor. Duels were fought not so much to kill the opponent as to gain "satisfaction", that is, to restore one's honor by demonstrating a willingness to risk one's life for it, and as such the tradition of dueling was originally reserved for the male members of nobility; however, in the modern era, it extended to those of the upper classes generally. On occasion, duels with pistols or swords were fought between women.
Legislation against dueling goes back to the medieval period. The Fourth Council of the Lateran (1215) outlawed duels, and civil legislation in the Holy Roman Empire against dueling was passed in the wake of the Thirty Years' War. From the early 17th century, duels became illegal in the countries where they were practiced. Dueling largely fell out of favor in England by the mid-19th century and in Continental Europe by the turn of the 20th century. Dueling declined in the Eastern United States in the 19th century and by the time the American Civil War broke out, dueling had begun to wane even in the South. Public opinion, not legislation, caused the change. Research has linked the decline of dueling to increases in state capacity.