Background: Abnormal sleep duration predicts depression and anxiety. We seek to evaluate the impact of sleep duration before stroke on the occurrence of depression and anxiety at 3 months after acute ischemic stroke (AIS).Methods: Nationally representative samples from the Third China National Stroke Registry were used to examine cognition and sleep impairment after AIS (CNSR-III-ICONS). Based on baseline sleep duration before onset of stroke as measured by using the Pittsburgh Sleep Quality Index (PSQI), 1,446 patients were divided into four groups: >7, 6–7, 5–6, and 7 h, 5–6 h, and