Previous studies have reported an association between circadian disturbances and age-related cognitive impairment. The aim was to study the 24-hour profiles of melatonin and cortisol in relation to cognitive function in middle-aged male subjects. Fifty healthy middle-aged males born in 1953 were recruited from a population-based cohort based on previous cognitive assessments in young adulthood and late midlife. The sample included 24 cognitively high-functioning and 26 cognitively impaired participants. Saliva samples were collected every 4 hours over a 24-hour period and analyzed for cortisol and melatonin levels by immunoassay. All participants exhibited clear circadian rhythms of salivary melatonin and cortisol. Salivary melatonin concentrations had a nocturnal peak at approximately 4 am. The median nocturnal melatonin response at 4 am was significantly lower in the cognitively impaired group than in the high-functioning group (−4.6 pg/mL, 95% CI: −7.84, −1.36, P=0.006). The 24-hour mean melatonin concentration (high-functioning group: 4.80±0.70 pg/mL, vs cognitively impaired group: 4.81±0.76 pg/mL; P>0.05) (or the area under the curve, AUC) was not significantly different between the two groups. Cortisol levels were low during the night, and peaked at approximately 8 am. Median cortisol concentrations were similar at all times, as were the 24-hour mean cortisol concentrations and AUC. To the best of our knowledge, ours is the first study to assess circadian measures (ie, melatonin and cortisol) in healthy middle-aged men with different cognitive trajectories in midlife. We found evidence of altered circadian rhythms with a reduced nocturnal melatonin response at 4 am in men with cognitive impairment. The 24-hour concentration and AUC of melatonin and cortisol were similar in the cognitively high-functioning group and in the cognitively impaired.