Background Although analgesics are initiated on hospital discharge in millions of adults each year, studies quantifying the risks of opioids and nonsteroidal anti-inflammatory drugs (NSAIDs) among older adults during this transition are limited. We sought to determine the incidence and risk of post-discharge adverse events among older adults with an opioid claim in the week after hospital discharge, compared to those with NSAID claims only. Methods and findings We performed a retrospective cohort study using a national sample of Medicare beneficiaries age 65 and older, hospitalized in United States hospitals in 2016. We excluded beneficiaries admitted from or discharged to a facility. We derived a propensity score that included over 100 factors potentially related to the choice of analgesic, including demographics, diagnoses, surgeries, and medication coadministrations. Using 3:1 propensity matching, beneficiaries with an opioid claim in the week after hospital discharge (with or without NSAID claims) were matched to beneficiaries with an NSAID claim only. Primary outcomes included death, healthcare utilization (emergency department [ED] visits and rehospitalization), and a composite of known adverse effects of opioids or NSAIDs (fall/fracture, delirium, nausea/vomiting, complications of slowed colonic motility, acute renal failure, and gastritis/duodenitis) within 30 days of discharge. After propensity matching, there were 13,385 beneficiaries in the opioid cohort and 4,677 in the NSAID cohort (mean age: 74 years, 57% female). Beneficiaries receiving opioids had a higher incidence of death (1.8% versus 1.1%; relative risk [RR] 1.7 [1.3 to 2.3], p < 0.001, number needed to harm [NNH] 125), healthcare utilization (19.0% versus 17.4%; RR 1.1 [1.02 to 1.2], p = 0.02, NNH 59), and any potential adverse effect (25.2% versus 21.3%; RR 1.2 [1.1 to 1.3], p < 0.001, NNH 26), compared to those with an NSAID claim only. Specifically, they had higher relative risk of fall/fracture (4.5% versus 3.4%; RR 1.3 [1.1 to 1.6], p = 0.002), nausea/vomiting (9.2% versus 7.3%; RR 1.3 [1.1 to 1.4], p < 0.001), and slowed colonic motility (8.0% versus 6.2%; RR 1.3 [1.1 to 1.4], p < 0.001). Risks of delirium, acute renal failure, and gastritis/duodenitis did not differ between groups. The main limitation of our study is the observational nature of the data and possibility of residual confounding. Conclusions Older adults filling an opioid prescription in the week after hospital discharge were at higher risk for mortality and other post-discharge adverse outcomes compared to those filling an NSAID prescription only., In a retrospective cohort study, Shoshana Herzig and colleagues investigate the incidence and risk of post-hospital discharge adverse events among those with claims for opioid analgesics compared to NSAIDs among older Medicare beneficiaries in the US., Author summary Why was this study done? Each year in the US, millions of older adults are hospitalized and prescribed medications intended for the treatment of pain on hospital discharge. Opioids and nonsteroidal anti-inflammatory drugs (NSAIDs) are among the most commonly used medications for the treatment of pain, but they carry risks. Studies comparing their risks during this vulnerable transition period are limited. What did the researchers do and find? We used records from the largest payer for healthcare in the US to study a nationwide sample of older adults who received an opioid or an NSAID prescription in the week after hospital discharge. We found that older adults filling an opioid prescription were at higher risk for death, healthcare utilization, falls/fractures, nausea/vomiting, and complications related to constipation, compared to those filling an NSAID prescription. Risk of acute renal failure and upper gastrointestinal complications did not differ between the groups. What do these findings mean? Our findings suggest that compared to opioids, NSAIDs are associated with fewer medication-related harms to older adults after discharge from the hospital; however, given that causality cannot be inferred from an observational study, these results should be tested in future studies. Additional research on the effectiveness of these medications among older adults hospitalized with various conditions would help to further understand overall risk to benefit ratio.