Osteonecrosis of the jaw (ONJ) is a rare but serious adverse event associated with antiresorptive treatment. There is little evidence regarding the incidence of ONJ among patients with osteoporosis who are treated with denosumab versus bisphosphonates (BPs). The aim of this study was to determine the risk of ONJ in a real‐world population. Subjects who underwent at least one dual‐energy X‐ray absorptiometry (DXA) examination were included in the osteoporosis register of the Swiss Society of Rheumatology between January 1, 2015, and September 30, 2019. Statistical analyses included incidence rates, rate ratios, and hazard ratios for ONJ, considering sequential therapies and drug holidays as covariates. Among 9956 registered patients, 3068 (89% female, median age 69 years [63 to 76]) were treated with BPs or denosumab for a cumulative duration of 11,101 and 4236 patient‐years, respectively. Seventeen cases of ONJ were identified: 12 in patients receiving denosumab at the time of ONJ diagnosis and 5 in patients receiving oral or intravenous BP therapy. The diagnosis of ONJ was confirmed by independent and blinded maxillofacial surgeons, using the American Association of Oral and Maxillofacial Surgeons case definition of ONJ. The incidence of ONJ per 10,000 observed patient‐years was 28.3 in patients receiving denosumab and 4.5 in patients with BP‐associated ONJ, yielding a rate ratio of 6.3 (95% confidence interval [CI] 2.1 to 22.8), p < 0.001. Nine of 12 patients who developed ONJ during denosumab treatment had been pretreated with BPs, but none of the 5 patients with BP‐related ONJ had previously received denosumab. The risk of ONJ was higher in patients receiving denosumab therapy compared with BPs (hazard ratio 3.49, 95% CI 1.16 to 10.47, p = 0.026). Previous BP therapy before switching to denosumab may be an additional risk factor for ONJ development. © 2021 American Society for Bone and Mineral Research (ASBMR).