Taxonomically restricted genes or lineage-specific genes contribute to morphological diversification in metazoans and provide unique functions for particular taxa in adapting to specific environments. To understand how such genes arise and participate in morphological evolution, we have investigated a gene called nematogalectin in Hydra, which has a structural role in the formation of nematocysts, stinging organelles that are unique to the phylum Cnidaria. Nematogalectin is a 28-kDa protein with an N-terminal GlyXY domain (glycine followed by two hydrophobic amino acids), which can form a collagen triple helix, followed by a galactose-binding lectin domain. Alternative splicing of the nematogalectin transcript allows the gene to encode two proteins, nematogalectin A and nematogalectin B. We demonstrate that expression of nematogalectin A and B is mutually exclusive in different nematocyst types: Desmonemes express nematogalectin B, whereas stenoteles and isorhizas express nematogalectin B early in differentiation, followed by nematogalectin A. Like Hydra, the marine hydrozoan Clytia also has two nematogalectin transcripts, which are expressed in different nematocyte types. By comparison, anthozoans have only one nematogalectin gene. Gene phylogeny indicates that tandem duplication of nematogalectin B exons gave rise to nematogalectin A before the divergence of Anthozoa and Medusozoa and that nematogalectin A was subsequently lost in Anthozoa. The emergence of nematogalectin A may have played a role in the morphological diversification of nematocysts in the medusozoan lineage.O rganisms within a phylum commonly share phenotypic traits that are unique to the phylum and strongly associated with specific adaptations. These phenotypic traits are often associated with taxonomically restricted genes. In Cnidaria, the nematocyst, an explosive organelle used to capture prey or repel predators, is such a phylum-specific trait. All nematocysts consist of two primary structures, a capsule and a tubule (1, 2) (Fig. S1A). Modifications of the nematocyst structure such as the capsule size and the armature of the tubule with spines generate different types of nematocysts. Anthozoans have simple nematocyst types (3), whereas medusozoans (Hydrozoa, Cubozoa, and Scyphozoa) have more complex nematocysts exhibiting various tubule and spine morphologies (4). Hydra, a freshwater hydrozoan, has four types of nematocysts: stenotele, desmoneme, holotrichous isorhiza, and atrichous isorhiza.Nematocysts are formed in large post-Golgi vacuoles during the differentiation of nematocytes. The capsule wall is formed on the inner surface of the vacuole, which grows in size with continuing input of precursor proteins from the Golgi complex (5). After completion of the capsule, tubule formation begins at the apical end, growing outward as a long extension that pushes the vacuole membrane into the cytoplasm (Fig. S1B). After completion of the external tubule, it invaginates through itself to form the internal tubule (1, 6); at that point, spines ar...