SummaryNon‐steroidal anti‐inflammatory drugs (NSAIDs) are one of the mainstays of multimodal pain management. While effective for acute pain control, recent pre‐clinical evidence has raised concerns regarding an association between NSAIDs and chronic pain and potential opioid use. Our objective was to explore the association between peri‐operative use of prescription NSAIDs and the need for continued opioid prescriptions lasting 90–180 days in previously opioid‐naïve patients undergoing total knee arthroplasty. A database of health claims in the USA was used to identify all opioid‐naïve adult patients who underwent primary knee arthroplasty between January 2010 and October 2021. We evaluated the magnitude of association between peri‐operative prescription NSAID claims and claims for opioids at 90 days postoperatively using multivariable logistic regression models. Secondary outcomes included: the magnitude of association between peri‐operative NSAID prescription and claims for opioids at 180 days postoperatively; and identifying other potential factors associated with opioid claims at 90 days postoperatively. After risk adjustment using multivariable logistic regression models in the 789,736‐patient cohort, the adjusted odds ratio (95%CI) for a continuous claim of opioids at 90 and 180 days postoperatively among patients with a peri‐operative NSAID prescription within 30 days was 1.32 (1.30–1.35), p < 0.001; and 1.12 (1.10–1.15), p < 0.001, respectively. This estimate of effect remained robust at 90 days after accounting for known potential confounders, including pre‐existing knee pain and acute postoperative pain severity. Similar analysis of other pain medications (e.g. paracetamol) did not detect such an association. This population‐based cohort study suggests that peri‐operative prescription NSAID use may be associated with continued opioid prescription claims at 90 and 180 days after knee arthroplasty, even after adjusting for other observed covariates for continuous opioid claims. These novel findings can inform clinical decision‐making for post‐surgical pain management, risk–benefit discussions with patients and future research.