Objective. We examined relationships of vitamin D status with over time changes in patterns of sleep in a longitudinal study of Whites and African-American urban middle-aged adults, while further testing effect modification by age group, sex and race and the potential roles of dietary and supplemental vitamin D.Methods. Data on 1,760 middle-aged participants in the Healthy Aging in Neighborhoods of Diversity Across the Life Span (HANDLS study: Age range at v2: 33-71y, mean±SD:53.0±8.8, % women: 58.4%, % African-American:60.3%) were used, with complete baseline 25-hydroxyvitamin D [25(OH)D] serum concentration data, initial selected covariates and mediators, and initial and/or follow-up data on five sub-scales (sleep duration, daytime dysfunction, sleep disturbance, sleep latency and sleep quality) of the Pittsburgh Sleep Quality Index. Mean±SD time between initial and follow-up visits: 4.1±1.5 years. Time-interval multiple mixed-effects linear regression models were used.Results. Upon multiple testing adjustment, among Whites, initial 25(OH)D was associated with better sleep duration [25(OH)D × TIME γ±SE: -0.027±0.011, P=0.017] and sleep quality [25(OH)D × TIME γ±SE: -0.026±0.010, P=0.008] over time, with heterogeneity by race found for both relationships (P<0.05 for 25(OH)D × TIME × Race in the un-stratified model). These relationships remained unaltered after further adjustment for dietary and supplemental vitamin D, indicating that this association may be largely explained by sunlight exposure.Limitations. Limitations included small sample size, selection bias, residual confounding and lack of objective sleep measures.Conclusions Vitamin D status, possibly through mechanisms involving sunlight exposure, was linked to a potential improvement in sleep duration and quality among White urban adults.