Background: Although social networks and activities have recently been suggested to protect against dementia, few long-term follow-up studies exist. The main purpose of our study was to evaluate whether midlife marital status is related to late-life cognitive function. Methods: Participants of the Cardiovascular Risk Factors, Aging, and Dementia (CAIDE) study were derived from random, population-based samples previously studied. After an average follow-up of 21 years, 1449 individuals (73%) aged 65 to 79 years were re-examined in 1998. At re-examination 139 persons were diagnosed with some form of cognitive impairment: 82 of those with mild cognitive impairment (MCI) and 48 with Alzheimer's disease (AD)). The relation between midlife marital status and cognitive impairment was analyzed with adjustments for a number of other midlife factors, including education, BMI, cholesterol, blood pressure, occupation, physical activity, smoking habits and depression. Adjustments were also made for ApoE status, age at follow-up and gender. Results: Persons living with a partner in midlife were significantly less likely to show cognitive impairment compared to all other categories (single, separated or widowed). The highest risk increase was found for those widowed at midlife and still so at the follow-up (N=105). For Alzheimers disease specifically, the risk increase was almost eight-fold for this group compared to those married both at midlife and still so at late-life. Progressive adjustments for possible confounders did not weaken the associations. Conclusions: Living in a partner relation may imply cognitive and social challenges with a protective effect against cognitive impairment. Involvement of other factors is however suggested by the specific risk increase for widowed in relation to singles. Possible selection bias behind the strongly increased cognitive impairment risk for those widowed at midlife, in relation to the married group, seems unlikely. The long-term prospective design should also preclude any reverse causation effects behind the results.