AimThis study aimed to investigate the association of social isolation, loneliness, and their trajectory with the risk of developing type 2 diabetes mellitus (T2DM) across genetic risk. MethodsWe included 439,337 participants (mean age 56.3 ± 8.1 years) enrolled in the UK Biobank study who were followed up until May 31, 2021. Social isolation and loneliness were self-reported and were further categorized into never, transient, incident, and persistent patterns. ResultsDuring a median follow-up of 12.7 years, 15,258 incident T2DM cases were documented. Social isolation (versus no social isolation: hazard ratio (HR) 95 % confidence interval (CI) 1.04 [1.00;1.09]) and loneliness (versus no loneliness: 1.26 [1.19;1.34]) were associated with an increased T2DM risk, independent of the genetic risk for T2DM. The interactions existed between social isolation and loneliness (Pinteraction < 0.05); the increased T2DM risk associated with social isolation was only significant among participants without loneliness. In the longitudinal analysis, only persistent social isolation (versus never social isolation: 1.22 [1.02;1.45]) was associated with an increased T2DM risk, whereas incident loneliness (versus never loneliness: 1.95 [1.40;2.71]) and persistent loneliness (2.00 [1.31;3.04]) were associated with higher T2DM risks. ConclusionSocial isolation and loneliness, especially their persistent pattern, were independently associated with an increased incident T2DM risk, irrespective of an individual's genetic risk. Loneliness modified the association between social isolation and incident T2DM.