The association of vitamin D deficiency, which is prevalent in type 2 diabetes mellitus (T2DM), with liver disease and related mortality has not been quantified. Our study aimed to (1) investigate whether there is a synergistic association of vitamin D deficiency and T2DM with liver-related outcomes and (2) explore whether high 25-hydroxyvitamin D [25(OH)D] concentrations are associated with a lower risk of liver-related outcomes in T2DM. Leveraging the data from UK Biobank, we conducted 2 studies: study I assessed the joint associations of vitamin D deficiency [25(OH)D <50nmol/L] and T2DM with liver-related outcomes among 439,276 participants, and study II explored the associations of vitamin D status with liver-related outcomes among 21,519 individuals with T2DM. Baseline T2DM was identified through medication, laboratory test, and electronic health-related records. Serum 25(OH)D was measured by direct competitive chemiluminescent immunoassay. Liver-related outcomes included 6 liver disease end points and mortality by overall liver disease, chronic liver disease, and severe liver disease. During an average follow-up duration of 11.6 years, we observed a significant positive additive interaction effect (all synergy index>1.0) of T2DM and vitamin D deficiency on the risk of liver-related outcomes. Compared with participants without either T2DM or vitamin D deficiency, the multivariable-adjusted HRs of overall liver diseases were 1.29 for participants without T2DM but with vitamin D deficiency, 1.73 for participants with T2DM but without vitamin D deficiency, and 2.19 for participants with both T2DM and vitamin D deficiency. In individuals with T2DM, we observed that participants without vitamin D deficiency were inversely associated with incident liver disease and related mortality (multivariable-adjusted HRs 0.41-0.81) when compared with individuals with vitamin D deficiency. There are positive synergistic associations of vitamin D deficiency and T2DM with liver-related outcomes. Inverse associations between serum 25(OH)D concentrations and liver-related outcomes were observed in individuals with T2DM.