Background: This study investigates the relationship between insomnia and cognitive dysfunctions including, subjective memory impairment (SMI), mild cognitive impairment (MCI), and dementia, by considering depression in a community sample of elderly individuals. Methods: Data for 1,740 elderly individuals aged 65 years and over were obtained from a nationwide dementia epidemiological study conducted in South Korea. Cognitive functional status was assessed by the Mini Mental State Examination and the Consortium to Establish a Registry for Alzheimer's Disease Assessment Packet Clinical Assessment Battery. Insomnia was defined as the presence of at least one of the four sleep complaints (difficulty in initiating sleep, difficulty in maintaining sleep, early morning awakening, and nonrestorative sleep), accompanied by moderate to severe daytime consequences. Depression was evaluated using the Geriatric Depression Scale. Results: The prevalence of insomnia in the patients with SMI, MCI, and dementia was found to be 23.2%, 19.6%, and 31.0%, respectively. The patients with SMI, MCI, and dementia were significantly more likely to have insomnia and the four sleep complaints than the normal comparison patients. After adjusting for sociodemographic factors, the significant relationships between cognitive dysfunctional status and insomnia remained. However, after adjusting for sociodemographic factors and depression, no significant relationships with any of the sleep complaints or insomnia remained. Conclusion: Insomnia is a very common complaint in the elderly with SMI, MCI, and dementia. Depression might play an important factor in the relationship between insomnia and cognitive dysfunctional status in the elderly.