OBJECTIVE : To describe prescribing of medicines in primary care in the last year of life in patients with dementia. METHODS : A retrospective cohort analysis in UK primary care using routinely collected data from the Clinical Practice Research Datalink. Number of medications and potentially inappropriate medication prescribed one year prior to, and including death, was ascertained. RESULTS : Dementia patients (n = 6923) aged 86.6 ± 7.3 years (mean ± SD) were prescribed 4.8 ± 4.0 drugs 1 year prior to death, increasing to 5.6 ± 4.0 2 months prior, before falling to 4.9 ± 4.1 at death. One year prior to death, 50% of patients were prescribed a potentially inappropriate medication, falling to 41% at death. Cardiovascular medications were the most common, with decreases in drug count only occurring in the last month prior to death. Prescriptions for gastrointestinal and central nervous system medication increased throughout the year, particularly laxatives/analgaesics, antidepressants and hypnotic/antipsychotics. Women (vs. men) and patients with Alzheimer's (vs. vascular dementia) were prescribed 4.7% (95% CI 2.3%-7%) and 14.6% (11.7-17.3%) fewer medications, respectively. Prescribing decreased with age and increased with additional comorbidities. CONCLUSIONS : Dementia patients are prescribed high levels of medication, many potentially inappropriate, during their last year of life, with reductions occurring relatively late. Improvements to medication optimisation guidelines are needed to inform decision-making around deprescribing of long-term medications in patients with limited life-expectancy.