Soldiers of some eusocial insects exhibit an altruistic self-destructive defense behavior in emergency situations when attacked by large enemies. The swarm-forming invasive millipede, Chamberlinius hualienensis, which is not classified as eusocial animal, exudes irritant chemicals such as benzoyl cyanide as a defensive secretion. Although it has been thought that this defensive chemical was converted from mandelonitrile, identification of the biocatalyst has remained unidentified for 40 years. Here, we identify the novel blood enzyme, mandelonitrile oxidase (ChuaMOX), which stoichiometrically catalyzes oxygen consumption and synthesis of benzoyl cyanide and hydrogen peroxide from mandelonitrile. Interestingly the enzymatic activity is suppressed at a blood pH of 7, and the enzyme is segregated by membranes of defensive sacs from mandelonitrile which has a pH of 4.6, the optimum pH for ChuaMOX activity. In addition, strong body muscle contractions are necessary for de novo synthesis of benzoyl cyanide. We propose that, to protect its swarm, the sacrificial millipede also applies a self-destructive defense strategy-the endogenous rupturing of the defensive sacs to mix ChuaMOX and mandelonitrile at an optimum pH. Further study of defensive systems in primitive arthropods will pave the way to elucidate the evolution of altruistic defenses in the animal kingdom.