Objectives: While recent studies showed that coffee consumption reduced the risk of all-cause mortality, no study has examined the effect of coffee consumption on all-cause mortality related to sleep disorders. We aimed to examine whether sleep-related disorders would differently affect the association between coffee consumption and the risk of all-cause mortality among 8,075 adults aged 40 to 69 years. Methods: In a prospective cohort study, the study participants were biennially followed up for 12 years from 2001 to 2012. On each follow-up visit, the participants underwent comprehensive tests including anthropometric examinations, interviewer-administered questionnaires, and biochemical tests. Coffee consumption frequency and the amount were measured using a semi-quantitative food frequency questionnaire. Using death certificate data from Korean National Statistical Office, the vital status of each study participant was identified. Sleep-related disorders were examined with interviewer-administered questionnaires. We estimated Hazard ratios and the corresponding 95% confidence intervals from Cox Proportional Hazard models. Multivariable models were established after adjusting for center, total caloric intake, age, gender, body mass index, physical activity, education, smoking, drinking, hypertension, diabetes, total cholesterol, c-reactive protein, energy-adjusted food groups of refined grains, vegetables, fruits, meat, fish, and dairy. Results: Compared with those who had no coffee consumption, participants who had about three cups of coffee per day showed a reduced risk of all-cause mortality, after adjusting for covariates. Those who had a sleep-related disorder showed no significant effect of coffee consumption on the risk of all-cause mortality, whereas those who had no sleep-related disorders showed significantly reduced risk of all-cause mortality. Conclusions: Our findings suggested that approximately three cups of coffee per day would be beneficial to reduce the risk of all-cause mortality only among adults with no sleep-related disorders. Coffee consumption should be prudent for those with sleep-related symptoms.