Circulating vitamin D concentrations have been associated with the risk of type 2 diabetes (T2D), but the results are inconsistent. Emerging evidence suggests that vitamin D metabolism is linked to sleep behaviors. We investigated the prospective association between serum 25-hydroxyvitamin D (25OHD) and the risk of incident T2D and whether such association was modified by sleep behaviors.The study included 350,211 individuals free of diabetes in the UK Biobank. Serum 25OHD (nmol/L) concentrations were measured. Five sleep behaviors including sleep duration, insomnia, snoring, chronotype, and daytime sleepiness were included to generate overall sleep patterns, defined by healthy sleep scores. We also calculated genetic risk scores of sleep patterns.During a median follow-up of 8.1 years, we documented 6,940 case subjects with incident T2D. We found that serum 25OHD was significantly associated with a lower risk of incident T2D, and the multivariate adjusted hazard ratio (HR) (95% CI) per 10 nmol/L increase was 0.88 (0.87-0.90). We found a significant interaction between 25OHD and overall sleep patterns on the risk of incident T2D (P for interaction = 0.002). The inverse association between high 25OHD and T2D was more prominent among participants with healthier sleep patterns. Among the individual sleep behaviors, daytime sleepiness showed the strongest interaction with 25OHD (P for interaction = 0.0006). The reduced HR of T2D associated with high 25OHD appeared to be more evident among participants with no frequent daytime sleepiness compared with those with excessive daytime sleepiness. The genetic variations of the sleep patterns did not modify the relation between 25OHD and T2D.Our study indicates that higher serum 25OHD concentrations are associated with a lower risk of incident T2D, and such relations are modified by overall sleep patterns, with daytime sleepiness being the major contributor.