We aimed to determine the burden of comorbidities at the time of diagnosis of multiple sclerosis (MS), the risk of developing new comorbidities after diagnosis and the effect of comorbidities on mortality in patients with MS. This study used data from 2526 patients with incident MS and 9980 age-, sex- and physician-matched controls without MS identified from the UK Clinical Practice Research Datalink. Before the MS diagnosis, the adjusted odds ratio for the association between MS and a Charlson comorbidity index score of 1-2, 3-4 or ≥5 was 131 [95% confidence interval (CI), 1.17-1.47], 1.65 (95% CI, 1.20-2.26) or 3.26 (95% CI, 1.58-6.70), respectively. MS was associated with increased risks of cardiovascular and neurological/mental diseases. After diagnosis, the adjusted hazard ratio for the association between MS and an increased risk of developing comorbidities was 1.13 (95% CI, 1.00-1.29). The risk of developing any comorbidity in terms of neoplasms, musculoskeletal/connective tissue diseases or neurological/mental diseases was higher in MS. Patients with MS had a higher mortality risk compared with controls, with a hazard ratio of 2.29 (95% CI, 1.81-2.73) after adjusting for comorbidities. There was a dose effect of pre-existing comorbidities on mortality. Patients with MS have an increased risk of developing multiple comorbidities both before and after diagnosis and pre-existing comorbidities have an impact on survival.