Commissural axons cross the nervous system midline and then turn to grow alongside it, neither recrossing nor projecting back into ventral regions. In Drosophila, the midline repellent Slit prevents recrossing: axons cross once because they are initially unresponsive to Slit, becoming responsive only upon crossing. We show that commissural axons in mammals similarly acquire responsiveness to a midline repellent activity upon crossing. Remarkably, they also become responsive to a repellent activity from ventral spinal cord, helping explain why they never reenter that region. Several Slit and Semaphorin proteins, expressed in midline and/or ventral tissues, mimic these repellent activities, and midline guidance defects are observed in mice lacking neuropilin-2, a Semaphorin receptor. Thus, Slit and Semaphorin repellents from midline and nonmidline tissues may help prevent crossing axons from reentering gray matter, squeezing them into surrounding fiber tracts.