A nematocyst often contains poison and its function is to capture prey and ward off enemies. It is a minute spherical or elongated capsule exclusively produced by members of the phylum Cnidaria, which includes corals, jellyfish and sea anemones. There are at least 25 known types of nematocysts as of 2014.
Each nematocyst is produced by a cell called a cnidoblast and made up of a coiled, hollow, barbed thread. This thread contains the poison used to capture prey and ward off enemies. When the capsule is stimulated by chemical or mechanical cues, a lidlike structure pops out from the top of the capsule, and the thread explosively everts in a twisting motion. As the twisting and eversion continue, the barbs act as a drill, first by penetrating into the foreign object and then pulling the thread into the object. If poison has already been produced, it quickly flows through the hollow thread and penetrates the prey's tissues to paralyze it.
After eversion, the thread detaches itself from the nematocyst. Some threads also ensnare the victim by wrapping around them. The stinging effect of some nematocysts, such as those produced by some jellyfish species, can be extremely painful, and may result in shock, paralysis or even death.