Neuroendocrine cells in the pineal gland release melatonin during the night and, in teleosts, are directly photoreceptive. During development of the pineal complex, a small number of cells migrate leftward away from the pineal anlage to form the parapineal cell cluster, a process that is crucial for asymmetrical development of the bilateral habenular nuclei. Here, we show that, throughout zebrafish embryonic development, the brain-specific homeobox (bsx) gene is expressed in all cell types of the pineal complex. We identified Bmp and Noto/Flh as major regulators of bsx expression in the pineal complex. Upon loss of Bsx through the generation of a targeted mutation, embryos fail to form a parapineal organ and develop right-isomerized habenulae. Crucial enzymes in the melatonin biosynthesis pathway are not expressed, suggesting the absence of melatonin from the pineal gland in bsx mutants. Several genes involved in rod-like or cone-like phototransduction are also abnormally expressed, indicating that Bsx has a pivotal role in the differentiation of multiple cell types in the zebrafish pineal complex.