Ecdysteroids regulate many key developmental events in arthropods including molting and metamorphosis. Recently, members of the Drosophila Halloween group of genes, that are required for embryonic viability and cuticle deposition, have been shown to code for several cytochrome P450 enzymes that catalyze the terminal hydroxylation steps in the conversion of cholesterol to the molting hormone 20-hydroxyecdysone. These P450s are conserved in other insects and each is thought to function throughout development as the sole mediator of a particular biosynthetic step since, where analyzed, each is expressed at all stages of development and shows no closely related homolog in their respective genomes. In contrast, we show here that several dipteran genomes encode two novel, highly related, microsomal P450 enzymes, Cyp307A1 and Cyp307A2, that likely participate as stage-specific components of the ecdysone biosynthetic machinery. This hypothesis comes from the observation that Cyp307A1 is encoded by the Halloween gene spook (spo), but unlike other Halloween class genes, Dmspo is not expressed during the larval stages. In contrast, Cyp307a2, dubbed spookier (spok), is expressed primarily during larval stages within the prothoracic gland cells of the ring gland. RNAi mediated reduction in the expression of this heterochromatin localized gene leads to arrest at the first instar stage which can be rescued by feeding the larva 20E, E or ketodiol but not 7dC. In addition, spok expression is eliminated in larvae carrying mutations in molting defective (mld), a gene encoding a nuclear zinc finger protein that is required for production of ecdysone during Drosophila larval development. Intriguingly, mld is not present in the Bombyx mori genome, and we have identified only one spook homolog in both Bombyx and Manduca that is expressed in both embryos and larva. These studies suggest an evolutionary split between Diptera and Lepidoptera in how the ecdysone biosynthetic pathway is regulated during development.