AbstractBackgroundPolypharmacy, the concurrent use of multiple medicines, is increasing. Population‐wide studies of its association with dementia are lacking. We examined this relationship longitudinally, at a national level.MethodWe used National Health Service community prescribing data from all adults in Scotland aged ≥50 years who received at least one drug in the first quarter of 2009. These data were linked to death records, including cause of death. We used Cox proportional hazards models to assess associations between the number of unique medicines dispensed in one quarter and mortality with any subtype of dementia over 8.5 years, in the whole sample and stratified by age.ResultThe sample contained 1,225,894 people aged ≥50 years (mean age 67.4 (SD = 10.8) years, 56.1% female, 3.8% care home residents). The mean number of drugs dispensed at baseline was 5.0 (SD = 3.7). Over 8.5 years, there were 336,244 deaths, of which 58,358 had any subtype of dementia on the death certificate.Among the whole sample, the hazard ratio (HR) for dementia mortality with each additional medicine was 1.027 (95% CI 1.024‐1.028). In people aged 50‐64 years, the HR was 1.075 (1.061‐1.089); for 65‐79 year‐olds, HR = 1.043 (1.040‐1.047) and for those aged ≥80 years, HR = 1.009 (1.006‐1.012). All models were adjusted for baseline age, gender, care home residence status and deprivation index based on postcode.ConclusionThere was higher mortality with dementia as the number of dispensed medicines increased. Age‐stratified analyses showed that the association was stronger in younger age groups, perhaps reflecting that younger people taking medication for more comorbidities had an increased risk of dying with dementia. These analyses did not allow adjustment for multimorbidity or the consideration of individual drug classes.