The pattern of development of the serotonergic nervous system is described from the larvae of ctenophores, platyhelminths, nemerteans, entoprocts, ectoprocts (bryozoans), molluscs, polychaetes, brachiopods, phoronids, echinoderms, enteropneusts and lampreys. The larval brain (apical ganglion) of spiralian protostomes (except nermerteans) generally has three serotonergic neurons and the lateral pair always innervates the ciliary band of the prototroch. In contrast, brachiopods, phoronids, echinoderms and enteropneusts have numerous serotonergic neurons in the apical ganglion from which the ciliary band is innervated. This pattern of development is much like the pattern seen in lamprey embryos and larvae, which leads the author to conclude that the serotonergic raphe system found in vertebrates originated in the larval brain of deuterostome invertebrates. Further, the neural tube of chordates appears to be derived, at least in part, from the ciliary band of deuterostome invertebrate larvae. The evidence shows no sign of a shift in the dorsal–ventral orientation within the line leading to the chordates.