Background: There is currently a knowledge gap regarding persistent opioid use after hip fracture surgery. Thus, opioid use within a year after hip fracture surgery in patients with/without opioid use before surgery was examined. Methods: This population-based cohort study included all patients (aged ≥ 65) undergoing primary hip fracture surgery in Denmark (2005–2015) identified from the Danish Multidisciplinary Hip Fracture Database. Opioid use was assessed from The Danish National Health Service Prescription Database as redeemed prescriptions. The proportion of patients with ≥1 opioid prescription was computed within 6 months before surgery and each of four 3-month periods (quarters) after surgery, among patients alive first day in each period. Proportion differences (95% CI) were calculated for each quarter compared to before surgery. Proportions were calculated for users and nonusers before surgery, including initiators after first quarter. Results: This study included 69,456 patients. Proportion differences of opioid users were 35.0 (95% CI 34.5–35.5), 7.0 (95% CI 6.5–7.5), 2.9 (95% CI 2.4–3.4) and 1.4 percentage-points (95% CI 0.9–1.9) the four quarters after surgery compared to before. Among opioid nonusers before surgery, 54.7% (95% CI 54.3–55.1), 21.8% (95% CI 21.4–22.2), 17.8% (95% CI 17.4–18.2) and 16.8% (95% CI 16.4–17.2) were opioid users in 1st-4th quarter after surgery. However, 8.5% (95% CI 8.2–8.7) of the nonusers before surgery in 4th quarter initiated opioid use more than a quarter after surgery. Conclusions: The proportion of opioid users increased after hip fracture surgery and was 1.4 percentage-points increased in fourth quarter compared to before. Of opioid nonusers before surgery, 16.8% were opioid users fourth quarter after surgery. Significance: Opioid use 1 year after hip fracture surgery is common, both in patients who were opioid users and nonusers before the surgery. These significant findings point out the need for indication of benefits and risks of opioid use in the acute and long-term management of patients undergoing hip fracture surgery.