The hornpipe originated as a solo dance among sailors in the 17th century. It later evolved into a popular form of dance in both maritime and Celtic traditions, with distinct regional variations.