Spinal cord injury (SCI) is a major cause of paralysis, and involves multiple cellular and tissular responses including demyelination, inflammation, cell death and axonal degeneration. Recent evidence suggests that perturbation on the homeostasis of the endoplasmic reticulum (ER) is observed in different SCI models; however, the functional contribution of this pathway to this pathology is not known. Here we demonstrate that SCI triggers a fast ER stress reaction (1-3 h) involving the upregulation of key components of the unfolded protein response (UPR), a process that propagates through the spinal cord. Ablation of X-box-binding protein 1 (XBP1) or activating transcription factor 4 (ATF4) expression, two major UPR transcription factors, leads to a reduced locomotor recovery after experimental SCI. The effects of UPR inactivation were associated with a significant increase in the number of damaged axons and reduced amount of oligodendrocytes surrounding the injury zone. In addition, altered microglial activation and pro-inflammatory cytokine expression were observed in ATF4 deficient mice after SCI. Local expression of active XBP1 into the spinal cord using adeno-associated viruses enhanced locomotor recovery after SCI, and was associated with an increased number of oligodendrocytes. Altogether, our results demonstrate a functional role of the UPR in SCI, offering novel therapeutic targets to treat this invalidating condition.