Steroid hormones regulate many physiological processes in vertebrates, nematodes, and arthropods through binding to nuclear receptors (NR), a metazoan-specific family of ligand-activated transcription factors. The main steps controlling the diversification of this family are now well-understood. In contrast, the origin and evolution of steroid ligands remain mysterious, although this is crucial for understanding the emergence of modern endocrine systems. Using a comparative genomic approach, we analyzed complete metazoan genomes to provide a comprehensive view of the evolution of major enzymatic players implicated in steroidogenesis at the whole metazoan scale. Our analysis reveals that steroidogenesis has been independently elaborated in the 3 main bilaterian lineages, and that steroidogenic cytochrome P450 enzymes descended from those that detoxify xenobiotics. evolution ͉ nuclear-receptor ligand ͉ steroidogenesis