Glucocorticoid-induced osteoporosis is the most common form of secondary osteoporosis and is associated with an estimated annual fracture rate of 5%. We aimed to assess the efficacy and safety of denosumab compared with risedronate in glucocorticoid-induced osteoporosis. We did a 24-month, double-blind, active-controlled, double-dummy, non-inferiority study at 79 centres in Europe, Latin America, Asia, and North America. Eligible patients were aged 18 years or older and were receiving glucocorticoids (≥7·5 mg prednisone daily, or equivalent) for at least 3 months (glucocorticoid continuing) or less than 3 months (glucocorticoid initiating) before screening. Patients younger than 50 years needed to have a history of osteoporosis-related fracture; glucocorticoid-continuing patients aged 50 years or older needed a lumbar spine, total hip, or femoral neck bone mineral density T score of -2·0 or less, or -1·0 or less if they had a history of osteoporosis-related fracture. Participants were randomly assigned (1:1) to either 60 mg subcutaneous denosumab every 6 months and oral placebo daily for 24 months, or 5 mg oral risedronate daily and subcutaneous placebo every 6 months for 24 months. Randomisation was stratified by sex within each subpopulation, and was done with an interactive voice-response system. Active drugs and corresponding placebos had identical packaging, labels, and appearance. The primary outcome was non-inferiority of denosumab to risedronate in terms of percentage change from baseline in lumbar spine bone mineral density at 12 months based on non-inferiority margins (-0·7 and -1·1 percentage points for the glucocorticoid-continuing and glucocorticoid-initiating subpopulations, respectively). Superiority was also assessed as a secondary outcome. The primary efficacy set included all randomly assigned participants who had a baseline and postbaseline lumbar spine bone mineral density measurement, and was analysed according to randomised treatment assignment. The safety analysis set included all randomly assigned participants who received at least one dose of investigational product, and was analysed by actual treatment received. This study is registered with ClinicalTrials.gov (NCT01575873) and is completed. Between March 28, 2012, and June 30, 2015, 795 patients, 505 of whom were glucocorticoid continuing and 290 of whom were glucocorticoid initiating, were enrolled and randomly assigned (398 to denosumab, 397 to risedronate). Denosumab was both non-inferior and superior to risedronate at 12 months for effect on bone mineral density at the lumbar spine in both glucocorticoid-continuing (4·4% [95% CI 3·8-5·0] vs 2·3% [1·7-2·9]; p<0·0001) and glucocorticoid-initiating (3·8% [3·1-4·5] vs 0·8% [0·2-1·5]; p<0·0001) subpopulations. Incidence of adverse events, serious adverse events (including infections), and fractures was similar between treatment groups. The most common adverse events were back pain (17 [4%] patients in the risedronate group and 18 [5%] in the denosumab group) and arthralgia (21 [5%] patients in the risedronate group and 17 [4%] in the denosumab group). Serious infection occurred in 15 (4%) patients in the risedronate group and 17 (4%) patients in the denosumab group. Denosumab could be a useful treatment option for patients newly initiating or continuing glucocorticoids who are at risk of fractures. Amgen.