Azathioprine is used as a first-line treatment to prevent relapses of neuromyelitis optica spectrum disorder (NMOSD). Tocilizumab has been reported to reduce NMOSD disease activity in retrospective case reports. We aimed to compare the safety and efficacy of tocilizumab and azathioprine in patients with highly relapsing NMOSD.We did an open-label, multicentre, randomised, phase 2 trial at six hospitals in China. We recruited adult patients (aged ≥18 years) with highly relapsing NMOSD diagnosed according to 2015 International Panel for Neuromyelitis Optica Diagnosis criteria, who had an Expanded Disability Status Scale (EDSS) score of 7·5 or lower, and had a history of at least two clinical relapses during the previous 12 months or three relapses during the previous 24 months with at least one relapse within the previous 12 months. Patients were randomly assigned (1:1) to intravenous tocilizumab (8 mg/kg every 4 weeks) or oral azathioprine (2-3 mg/kg per day) by an independent statistician using computer-generated randomisation software with permuted blocks of four. The central review committee, EDSS raters, laboratory personnel, and radiologists were masked to the treatment assignment, but investigators and patients were aware of treatment allocation. The minimum planned duration of treatment was 60 weeks following randomisation. The primary outcome was time to first relapse in the full analysis set, which included all randomly assigned patients who received at least one dose of study drug, and the per-protocol population, which included all patients who used azathioprine or tocilizumab as monotherapy. For the analyses of the primary outcome, the patients were prespecified into two subgroups according to concomitant autoimmune disease status. Safety was assessed in the full analysis set. This study is registered with ClinicalTrials.gov, NCT03350633.Between Nov 1, 2017, and Aug 3, 2018, we enrolled 118 patients, of whom 59 were randomly assigned to tocilizumab and 59 were randomly assigned to azathioprine. All 118 patients received one dose of study drug and were included in the full analysis set. 108 participants were included in the per-protocol analysis (56 in the tocilizumab group and 52 in the azathioprine group). In the full analysis set, median time to the first relapse was longer in the tocilizumab group than the azathioprine group (78·9 weeks [IQR 58·3-90·6] vs 56·7 [32·9-81·7] weeks; p=0·0026). Eight (14%) of 59 patients in the tocilizumab group and 28 (47%) of 59 patients in the azathioprine group had a relapse at the end of the study (hazard ratio [HR] 0·236 [95% CI 0·107-0·518]; p<0·0001). In the per-protocol analysis, 50 (89%) of 56 patients in the tocilizumab group were relapse-free compared with 29 (56%) of 52 patients in the azathioprine group at the end of the study (HR 0·188 [95% CI 0·076-0·463]; p<0·0001); the median time to first relapse was also longer in the tocilizumab group than the azathioprine group (67·2 weeks [IQR 47·9-77·9] vs 38·0 [23·6-64·9]; p<0·0001). In the prespecified subgroup analysis of the full analysis set stratified by concomitant autoimmune diseases, among patients without concomitant autoimmune diseases, three (9%) of 34 patients in the tocilizumab group and 13 (35%) of 37 patients in the azathioprine group had relapsed by the end of the study. Among patients with concomitant autoimmune diseases, a lower proportion of patients in the tocilizumab group had a relapse than in the azathioprine group (five [20%] of 25 patients vs 15 [68%] of 22 patients; HR 0·192 [95% CI 0·070-0·531]; p=0·0004). 57 (97%) of 59 patients in the tocilizumab group and 56 (95%) of 59 patients in the azathioprine group had adverse events. Treatment-associated adverse events occurred in 36 (61%) of 59 tocilizumab-treated patients and 49 (83%) of 59 azathioprine-treated patients. One death (2%) occurred in the tocilizumab group and one (2%) in the azathioprine group, but neither of the deaths were treatment-related.Tocilizumab significantly reduced the risk of a subsequent NMOSD relapse compared with azathioprine. Tocilizumab might therefore be another safe and effective treatment to prevent relapses in patients with NMOSD.Tianjin Medical University, Advanced Innovation Center for Human Brain Protection, National Key Research and Development Program of China, National Science Foundation of China.