OBJECTIVES: The purpose of this study was to investigate dietary contributors to relationships between sleep and all-cause mortality among elderly men and women using a prospective cohort study. SETTING: The representative Nutrition and Health Survey in Taiwan (NAHSIT) for elders during 1999-2000. SUBJECTS: One thousand eight hundred sixty-five individuals aged ≥ 65 years from NAHSIT (942 men and 923 women). MEASURES OF OUTCOME: Dietary diversity scores (DDS) were from 24-hour dietary recalls. Participants were examined and fasting blood was taken. Sleep quality was assessed by questionnaire and classified as poor, fair, or good. Death registry linkage was made until December 31, 2008. RESULTS: For women, poor sleepers had significantly lower vegetable and vitamin B-6 intakes compared to good sleepers (p < 0.05). For men, good and fair sleepers had a lower risk of death compared to poor sleepers after adjustment with hazards ratios (HRs) and 95% confidence intervals (CIs) of 0.60 (0.42-0.87) and 0.55 (0.36-0.86). The joint HRs for "DDS > 4 and good sleep" were 0.38 (0.22-0.66) for men and 0.52 (0.30-0.88) for women compared to "DDS ≤ 4 and poor sleep." The joint HRs for "plasma pyridoxal phosphate (PLP) adequate and fair sleep" were 0.27 (0.11-0.65) and 0.49 (0.23-1.07) compared to "insufficient and poor sleep" for men and women; for women, PLP adequacy provided significantly reduced HRs for good and poor sleep. CONCLUSIONS: Sleep quality played a more important role in mortality for men than for women. Sufficient dietary diversity in men could offset the adverse effect on mortality of poor sleep. In women, PLP predicts mortality more than sleep does.