Myelin destruction is followed by resident glia activation and mobilization of endogenous progenitors (OPC) which participate in myelin repair. Here we show that in response to demyelination, mature oligodendrocytes (OLG) bordering the lesion express Ndst1, a key enzyme for heparan sulfates (HS) synthesis. Ndst1+ OLG form a belt that demarcates lesioned from intact white matter. Mice with selective inactivation of Ndst1 in the OLG lineage display increased lesion size, sustained microglia and OPC reactivity. HS production around the lesion allows Sonic hedgehog (Shh) binding and favors the local enrichment of this morphogen involved in myelin regeneration. In MS patients, Ndst1 is also found overexpressed in oligodendroglia and the number of Ndst1-expressing oligodendroglia is inversely correlated with lesion size and positively correlated with remyelination potential. Our study suggests that mature OLG surrounding demyelinated lesions are not passive witnesses but contribute to protection and regeneration by producing HS.