BackgroundEvidence on the association between serum 25-hydroxyvitamin D [25(OH)D] and infections among patients with type 2 diabetes (T2D), a group susceptible to vitamin D deficiency and infections, is limited. ObjectivesWe aimed to examine this association in individuals with T2D, and to evaluate whether genetic variants in vitamin D receptor (VDR) would modify this association. MethodsThis study included 19,851 participants with T2D from United Kingdom Biobank. Infections were identified by linkage to hospital inpatient and death registers. Negative binomial regression models were used to estimate incidence rate ratios (IRRs) and 95% confidence intervals (CIs), with adjustment of potential confounders. ResultsIn patients with T2D, the incidence rate of infections was 29.3/1000 person-y. Compared with those with 25(OH)D of 50.0–74.9 nmol/L, the multivariable-adjusted IRRs and 95% CIs of total infections, pneumonia, gastrointestinal infections, and sepsis were 1.44 (1.31, 1.59), 1.49 (1.27, 1.75), 1.47 (1.22, 1.78), and 1.41 (1.14, 1.73), respectively, in patients with 25(OH)D <25.0 nmol/L. Nonlinear inverse associations between 25(OH)D concentrations and the risks of total infections (P-overall < 0.001; P-nonlinear = 0.002) and gastrointestinal infections (P-overall < 0.001; P-nonlinear = 0.040) were observed, with a threshold effect at ∼50.0 nmol/L. The vitamin D-infection association was not modified by genetic variants in VDR (all P-interaction > 0.050). ConclusionsIn patients with T2D, lower serum 25(OH)D concentration (<50 nmol/L) was associated with higher risks of infections, regardless of genetic variants in VDR. Notably, nonlinear inverse associations between 25(OH)D concentrations and the risks of infections were found, with a threshold effect at ∼50.0 nmol/L. These findings highlighted the importance of maintaining adequate vitamin D in reducing the risk of infections in patients with T2D.