The overall aim was to explore the prevalence and persistent regular prescription of opioids and paracetamol among nursing home (NH) residents with dementia at admission and over time. A total of 996 residents with dementia, mean (SD) age 84.5 (7.6) years and (36.1% men), were included at admission (A1). Yearly assessments were performed for two years (A2 and A3) or until death. Pain was assessed using the Mobilization-Observation-Behavior-Intensity-Dementia-2 (MOBID-2) Pain Scale. Information regarding prescription of analgesics, general physical health, personal activities of daily living, severity of dementia, neuropsychiatric symptoms, and prescription of psychotropic drugs was collected. A generalized linear mixed model was used to explore whether pain severity was associated with persistent and persistent prescription of opioids and/or paracetamol across timepoints. At A1, 495 of 996 (49.7%) NH residents were prescribed analgesics and prevalence increased at the follow-ups (A2: n = 630, 65.1%; A3: n = 382, 71.2%). Paracetamol was the most frequently prescribed analgesic at all assessments (A1: 45.5%; A2: 59.5%; A3: 67.1%). Opioid prescriptions were quite prevalent (A1: 18.1%; A2: 25.1%; A3: 28.3%), with odds approximately 13 times (OR = 13.3, 95% CI 6.8–26.0) and 9 times (OR = 8.6, 95% CI 3.7–20.3) higher for prescription at follow-up A2 and A3, respectively, relative to prescription at A1. In adjusted analyses, higher pain intensity and poor physical health were associated with prescription and persistent prescription of opioids and paracetamol. In conclusion, prevalence and persistent prescription of analgesics were high in NH residents with dementia. The odds for the prescription of opioids at follow-up were high if prescribed at baseline. Interdisciplinary collaboration, routine assessment of pain at admission and regularly thereafter, and systematic drug reviews are essential to adequately assess and treat pain in NH residents with dementia.