ObjectiveThis study aims to investigate the correlation between sleep duration and all-cause and cardiovascular mortality in the general population.MethodsA total of 26,977 participants aged ≥18 years were included in the analysis from the National Health and Nutrition Examination Survey (NHANES) database covering the period from 2005 to 2014. Data on cardiovascular and all-cause deaths were collected until December 2019. Sleep duration was assessed using a structured questionnaire, and participants were categorized into five groups based on their reported sleep duration (≤5, 6, 7, 8, or ≥9 h). Kaplan-Meier survival curves were employed to examine the mortality rates across different sleep duration groups. Multivariate Cox regression models were utilized to explore the association between sleep duration and mortality. Additionally, a restricted cubic spline regression model was employed to identify the non-linear relationship between sleep duration and all-cause and cardiovascular mortality.ResultsThe average age of participants was 46.23 ± 18.48 years, with 49.9% of the subjects being male. Over a median follow-up period of 9.42 years, 3,153 (11.7%) participants died from all-cause mortality, among which 819 (3.0%) were attributed to cardiovascular causes. The groups with sleep durations of ≥9 and ≤5 h exhibited the lowest cumulative survival rates for all-cause mortality and cardiovascular mortality, respectively. When using a sleep duration of 7 h as the reference, the hazard ratios (with 95% confidence intervals) for all-cause mortality were 1.28 (1.14–1.44) for ≤5 h, 1.10 (0.98–1.23) for 6 h, 1.21 (1.10–1.34) for 8 h, and 1.53 (1.35–1.73) for ≥9 h. The hazard ratios (with 95% confidence intervals) for cardiovascular mortality were 1.32 (1.04–1.67) for ≤5 h, 1.22 (0.97–1.53) for 6 h, 1.29 (1.05–1.59) for 8 h, and 1.74 (1.37–2.21) for ≥9 h. A U-shaped non-linear relationship between sleep duration and all-cause and cardiovascular mortality was observed, with inflection point thresholds at 7.32 and 7.04 h, respectively.ConclusionThe findings suggest that the risk of all-cause and cardiovascular mortality is minimized when sleep duration is approximately 7 h.