Multiple sclerosis risk has a well-established polygenic component, yet the genetic contribution to disease course and severity remains unclear and difficult to examine. Accurately measuring disease progression requires long-term study of clinical and radiological outcomes with sufficient follow-up duration to confidently confirm disability accrual and multiple sclerosis phenotypes. In this retrospective study, we explore genetic influences on long-term disease course and severity; in a unique cohort of clinically isolated syndrome patients with homogenous 30-year disease duration, deep clinical phenotyping and advanced MRI metrics. Sixty-one clinically isolated syndrome patients [41 female (67%): 20 male (33%)] underwent clinical and MRI assessment at baseline, 1-, 5-, 10-, 14-, 20- and 30-year follow-up (mean age ± standard deviation: 60.9 ± 6.5 years). After 30 years, 29 patients developed relapsing-remitting multiple sclerosis, 15 developed secondary progressive multiple sclerosis and 17 still had a clinically isolated syndrome. Twenty-seven genes were investigated for associations with clinical outcomes [including disease course and Expanded Disability Status Scale (EDSS)] and brain MRI (including white matter lesions, cortical lesions, and brain tissue volumes) at the 30-year follow-up. Genetic associations with changes in EDSS, relapses, white matter lesions and brain atrophy (third ventricular and medullary measurements) over 30 years were assessed using mixed-effects models. HLA-DRB1*1501 -positive ( n = 26) patients showed faster white matter lesion accrual [+1.96 lesions/year (0.64-3.29), P = 3.8 × 10 -3 ], greater 30-year white matter lesion volumes [+11.60 ml, (5.49-18.29), P = 1.27 × 10 -3 ] and higher annualized relapse rates [+0.06 relapses/year (0.005-0.11), P = 0.031] compared with HLA-DRB1*1501 -negative patients ( n = 35). PVRL2 -positive patients ( n = 41) had more cortical lesions (+0.83 [0.08-1.66], P = 0.042), faster EDSS worsening [+0.06 points/year (0.02-0.11), P = 0.010], greater 30-year EDSS [+1.72 (0.49-2.93), P = 0.013; multiple sclerosis cases: +2.60 (1.30-3.87), P = 2.02 × 10 -3 ], and greater risk of secondary progressive multiple sclerosis [odds ratio (OR) = 12.25 (1.15-23.10), P = 0.031] than PVRL2 -negative patients ( n = 18). In contrast, IRX1 -positive ( n = 30) patients had preserved 30-year grey matter fraction [+0.76% (0.28-1.29), P = 8.4 × 10 -3 ], lower risk of cortical lesions [OR = 0.22 (0.05-0.99), P = 0.049] and lower 30-year EDSS [-1.35 (-0.87,-3.44), P = 0.026; multiple sclerosis cases: -2.12 (-0.87, -3.44), P = 5.02 × 10 -3 ] than IRX1 -negative patients ( n = 30). In multiple sclerosis cases, IRX1 -positive patients also had slower EDSS worsening [-0.07 points/year (-0.01,-0.13), P = 0.015] and lower risk of secondary progressive multiple sclerosis [OR = 0.19 (0.04-0.92), P = 0.042]. These exploratory findings support diverse genetic influences on pathological mechanisms associated with multiple sclerosis disease course. HLA-DRB1*1501 influenced white matter inflammation and relapses, while IRX1 (protective) and PVRL2 (adverse) were associated with grey matter pathology (cortical lesions and atrophy), long-term disability worsening and the risk of developing secondary progressive multiple sclerosis., Competing Interests: N.S. has been a clinical research fellow in a post supported by Merck (supervised by S.A.T. and D.C.) and subsequently by MRC (MR/W019906/1). K.C has received honoraria for participation and attendance of educational events from Novartis, Roche, Biogen and Merck; she has received honoraria for consultancy work from Novartis, Roche, Biogen, Merck and Viatris. F.P.C. received a Guarantors of Brain fellowship 2017–2020. F.P.C. and B.K. are supported by the National Institute for Health Research (NIHR), Biomedical Research Centre initiative at University College London Hospitals (UCLH). A.J.T. reports personal fees paid to his institution from Eisai Ltd; is an editorial board member for The Lancet Neurology receiving a free subscription; is Editor-in-Chief for MS Journal receiving an honorarium from SAGE Publications; receives support for travel as member, Clinical Trials Committee, International PPMS Alliance, and from the National MS Society (NMSS) (USA) as member, NMSS Research Programs Advisory Committee. S.A.T. receives support from the UCLH Biomedical Research Centre; has received honoraria from Roche, Merck, Novartis, Sanofi-Genzyme and Biogen in the last 3 years and co-supervises a clinical fellowship at the National Hospital for Neurology and Neurosurgery, London, which is supported by Merck. W.B. has received speaker honoraria for educational activities and/or acted as a consultant for Biogen, Janssen, Merck, Novartis, Roche, Sanofi-Genzyme and Viatris. O.C. is a member of independent data and safety monitoring board for Novartis, gave a teaching talk on McDonald criteria in a Merck local symposium, and contributed to an Advisory Board for Biogen; she is Deputy Editor of Neurology, for which she receives an honorarium. C.T. is currently being funded by a Junior Leader La Caixa Fellowship (The project that gave rise to these results received the support of a fellowship from ‘la Caixa’ Foundation (ID 100010434); fellowship code is LCF/BQ/PI20/117600080; She has also received the 2021 Merck’s Award for the Investigation in MS (Spain) and a grant from Instituto de Salud Carlos III (ISCIII), Spain (grant ID: PI21/01860); In 2015, she received an ECTRIMS Post-doctoral Research Fellowship and has received funding from the UK Multiple Sclerosis Society (grant number 77); She has also received speaker honoraria from Roche and Novartis; She serves on the Editorial Board of Neurology and Multiple Sclerosis Journal. F.B. is supported by the UCLH biomedical research centre; He is a steering committee or iDMC member for Biogen, Merck, Roche, EISAI and Prothena; He is a consultant for Roche, Biogen, Merck, IXICO, Jansen, Combinostics; He has research agreements with Merck, Biogen, GE Healthcare, Roche; He is co-founder and shareholder of Queen Square Analytics LTD. D.C. is a consultant for Hoffmann-La Roche; In the last three years he has been a consultant for Biogen, received research funding from Hoffmann-La Roche, the International Progressive Multiple Sclerosis Alliance, the Multiple Sclerosis Society, and the National Institute for Health Research (NIHR) University College London Hospitals (UCLH) Biomedical Research Centre, and speaker’s honorarium from Novartis; He co-supervises a clinical fellowship at the National Hospital for Neurology and Neurosurgery, London, which is supported by Merck. The remaining authors, L.H., R.S., C.A.M.G.W.K. and H.H.: nothing to disclose., (© The Author(s) 2023. Published by Oxford University Press on behalf of the Guarantors of Brain.)