Persons with Alzheimer disease (AD) commonly present with chronic nonmalignant pain, but long-term use of opioids among this population has not been studied previously. Our aim was to investigate the prevalence of long-term (≥180 days) use of opioids for nonmalignant pain and associated factors among community-dwelling persons with AD and to compare the prevalence with a matched cohort without AD. The Medication use and Alzheimer's disease (MEDALZ) cohort was used for this study, comprising all community-dwelling persons diagnosed with AD in Finland during 2005 to 2011 and their matched comparison persons without AD. After exclusion of persons with active cancer treatment, 62,074 persons with and 62,074 persons without AD were included in this study. Data were collected from nationwide registers. Opioids were used by 13,111 persons with and by 16,659 without AD. Overall long-term opioid use was more common among persons without AD (8.7%) than among persons with AD (7.2%, P < 0.0001). However, among opioid users, prevalence of long-term opioid use was slightly higher among persons with AD than among those without AD (34.2% vs 32.3%, respectively, P = 0.0004). Long-term use of transdermal opioids was more than 2-fold among opioid users with AD (13.2%) compared with users without AD (5.5%). Factors associated with long-term opioid use included AD, age ≥80 years, female sex, rheumatoid arthritis, osteoporosis, low socioeconomic position, history of substance abuse, and long-term benzodiazepine use. Prevalence of long-term opioid use was somewhat similar among both groups. Among persons with AD, long-term opioid use was strongly associated with transdermal opioids.