Metazoans rely on aerobic energy production, which requires an adequate oxygen supply. During reduced oxygen supply (hypoxia), the most profound changes in gene expression are mediated by transcription factors known as hypoxia-inducible factors (HIFs). HIF alpha proteins are commonly posttranslationally regulated by prolyl-4-hydroxylase (PHD) enzymes, which are direct "sensors" of cellular oxygen levels. We examined the molecular evolution of the metazoan PHD-HIF oxygen-sensing system by constructing complete phylogenies for PHD and HIF alpha genes and used computational tools to characterize the molecular changes underlying the functional divergence of PHD and HIF alpha duplicates. The presence of PHDs in metazoan genomes predates the emergence of HIF alphas. Our analysis revealed an unexpected diversity of PHD genes and HIF alpha sequence characteristics in invertebrates, suggesting that the simple oxygen-sensing systems of Caenorhabditis and Drosophila may not be typical of other invertebrate bilaterians. We studied the early vertebrate evolution of the system by sequencing these genes in early-diverging cartilaginous fishes, elasmobranchs. Cartilaginous fishes appear to have three paralogs of both PHD and HIF alpha. The novel sequences were used as outgroups for a detailed molecular analysis of PHD and HIF alpha duplicates in a major air-breathing vertebrate lineage, the mammals, and a major water-breathing vertebrate lineage, the teleosts. In PHDs, functionally divergent amino acid sites were detected near the HIF alpha-binding channel and beta2beta3 loop that defines its substrate specificity. In HIF alphas, more functional divergence was found in teleosts than in mammals, especially in the HIF-1 alpha PAS domain and HIF-2 alpha oxygen-dependent degradation (ODD) domains, which interact with PHDs. Overall, in the vertebrates, elevated substitution rates in the HIF-2 alpha N-terminal ODD domain, together with a functional divergence associated with the known differences in PHD2 versus PHD1/3 substrate specificity, have contributed to the tighter oxygen-sensitive regulation of HIF-1 alpha than that of HIF-2 alpha.