The mechanisms of hypoxic injury to the developing human brain are poorly understood, despite being a major cause of chronic neurodevelopmental impairments. Recent work in the invertebrate Caenorhabditis elegans has shown that hypoxia causes discrete axon pathfinding errors in certain interneurons and motorneurons. However, it is unknown whether developmental hypoxia would have similar effects in a vertebrate nervous system. We have found that developmental hypoxic injury disrupts pathfinding of forebrain neurons in zebrafish (Danio rerio), leading to errors in which commissural axons fail to cross the midline. The pathfinding defects result from activation of the hypoxia-inducible transcription factor (hif1) pathway and are mimicked by chemical inducers of the hif1 pathway or by expression of constitutively active hif1α. Further, we found that blocking transcriptional activation by hif1α helped prevent the guidance defects. We identified ephrinB2a as a target of hif1 pathway activation, showed that knock-down of ephrinB2a rescued the guidance errors, and showed that the receptor ephA4a is expressed in a pattern complementary to the misrouting axons. By targeting a constitutively active form of ephrinB2a to specific neurons, we found that ephrinB2a mediates the pathfinding errors via a reverse-signaling mechanism. Finally, magnesium sulfate, used to improve neurodevelopmental outcomes in preterm births, protects against pathfinding errors by preventing upregulation of ephrinB2a. These results demonstrate that evolutionarily conserved genetic pathways regulate connectivity changes in the CNS in response to hypoxia, and they support a potential neuroprotective role for magnesium.