Axon regeneration is limited in the central nervous system, which hinders the reconstruction of functional circuits following spinal cord injury (SCI). Although various extrinsic molecules to repel axons following SCI have been identified, the role of semaphorins, a major class of axon guidance molecules, has not been thoroughly explored. Here we show that expression of semaphorins, including Sema5a and Sema6d, is elevated after SCI, and genetic deletion of either molecule or their receptors (neuropilin1 and plexinA1, respectively) suppresses axon retraction or dieback in injured corticospinal neurons. We further show that Olig2+ cells are essential for SCI-induced semaphorin expression, and that Olig2 binds to putative enhancer regions of the semaphorin genes. Finally, conditional deletion of Olig2 in the spinal cord reduces the expression of semaphorins, alleviating the axon retraction. These results demonstrate that semaphorins function as axon repellents following SCI, and reveal a novel transcriptional mechanism for controlling semaphorin levels around injured neurons to create zones hostile to axon regrowth.