High pain levels immediately after surgery have been associated with persistent postsurgical pain. Still, it is uncertain if analgesic treatment of immediate postsurgical pain prevents the development of persistent postsurgical pain. We searched MEDLINE, CENTRAL, and Embase up to September 12, 2023, for randomized controlled trials investigating perioperative analgesic interventions and with reported pain levels 3 to 24 months after total hip or knee arthroplasty in patients with osteoarthritis. The primary outcome was pain score 3 to 24 months after surgery, assessed at rest and during movement separately. Two authors independently screened, extracted data, and assessed risk of bias using the Cochrane Risk of Bias 2 tool. We conducted meta-analyses and tested their robustness with trial sequential analyses and worst-best and best-worst case analyses. We included 49 trials with 68 intervention arms. All but 4 trials were at high risk of bias for the primary outcome. Moreover, the included trials were heterogeneous in terms of exclusion criteria, baseline pain severity, and which cointerventions the participants were offered. For pain at rest, no interventions demonstrated a statistically significant difference between intervention and control. For pain during movement, perioperative treatment with duloxetine (7 trials with 641 participants) reduced pain scores at 3 to 24 months after surgery (mean difference -4.9 mm [95% confidence interval {CI}, -6.5 to -3.4] on the 0-100 visual analog scale) compared to placebo. This difference was lower than our predefined threshold for clinical importance of 10 mm. We found no perioperative analgesic interventions that reduced pain 3 to 24 months after total hip or knee arthroplasty for osteoarthritis. The literature on perioperative analgesia focused little on potential long-term effects. We encourage the assessment of long-term pain outcomes.