Larvae of the genus Megalopyge (Lepidoptera: Zygaenoidea: Megalopygidae), called asp or puss caterpillars, produce defensive venoms that cause severe acute pain. Here, we present the anatomy, chemistry, and mode of action of the venom systems of caterpillars of two megalopygid species, the Southern flannel moth Megalopyge opercularis and the black-waved flannel moth Megalopyge crispata. We show that megalopygid venom is produced in secretory cells that lie beneath the cuticle and are connected to the venom spines by canals. Megalopygid venoms consist of larger aerolysin-like pore-forming toxins, which we have named megalysins, and a small number of peptides. Venom potently activates mammalian sensory neurons via membrane permeabilization and causes sustained spontaneous pain behaviours and paw swelling in mice. These bioactivities can be easily ablated by treatment with heat, organic solvents, or proteases, suggesting they are mediated by larger proteins, most likely the megalysins. We show that the megalysins were recruited as venom toxins in the Megalopygidae following horizontal transfer of genes from bacteria to the ancestors of Lepidoptera. The megalopygid venom system differs markedly from those of previously studied venomous zygaenoids of the family Limacodidae, suggestive of independent origins. Megalopygids have recruited aerolysin-like proteins as venom toxins convergently with centipedes, cnidarians, and fish. This study highlights the role of horizontal gene transfer in venom evolution.