Normal cognitive function depends on sufficient supply and efficient utilization of oxygen in the brain. Prospective studies on respiratory function and dementia are lacking. This study investigated the relationship between midlife respiratory function and incidence of dementia in a population-based sample of 1291 women followed from 1974 to 2003. Respiratory function was measured by peak expiratory flow in 1974, and forced vital capacity and forced expiratory volume in 1980. Dementia diagnoses were based on information from neuropsychiatric examinations, informant interviews, hospital records and registry data. Better respiratory function in midlife was associated with a lower late-life risk of developing dementia and Alzheimer's disease (AD). Per 1 standard deviation increase in peak expiratory flow, forced vital capacity and forced expiratory volume, hazard ratios (95% confidence intervals) for dementia were 0.77 (0.65-0.91), 0.72 (0.57-0.92) and 0.75 (0.59-0.95), respectively, and for AD 0.76 (0.62-0.94), 0.71 (0.54-0.95) and 0.74 (0.56-0.98), respectively, after adjustment for potential confounders. These data reinforce the advantages of maintaining good respiratory function in midlife, even though causation cannot be established.