We aimed to assess the long-term safety and effectiveness of ocrelizumab in a cohort of patients with multiple sclerosis (MS) at high risk of progressive multifocal leukoencephalopathy (PML), previously treated with natalizumab in extending interval dosing (EID), who switched to ocrelizumab and to compare them with patients who continued EID-natalizumab. Thirty MS patients previously treated with natalizumab in EID (every 8 weeks) were included in this observational retrospective cohort study. Among them, 17 patients were switched to ocrelizumab and 13 continued with EID-natalizumab. Except for the John Cunningham virus (JCV) index, no significant differences were detected between both groups. Main outcome measures included: annualized relapse rate (ARR), radiological activity, disability progression, and the NEDA-3 index. Patients were followed for 96 weeks. The median washout period in ocrelizumab-switchers was 6 weeks. Among them, AAR and radiological activity during follow-up were 0.03, without significant differences in comparison with the previous period on natalizumab-EID. The comparison between ocrelizumab-switchers and patients continuing on EID-natalizumab showed no significant differences in AAR, radiological activity, or disability progression. However, the proportion of patients maintaining a NEDA-3 status in week 96 was slightly superior among ocrelizumab-switchers (94 vs 69%). No serious adverse events were observed in any group. In conclusion, switching from EID-natalizumab to ocrelizumab can be considered as a therapeutic option, particularly in patients with MS at high risk of PML, to mitigate the risks of both PML and disease reactivation.