Background The interleukin-23 pathway is implicated genetically and biologically in the pathogenesis of Crohn's disease. We aimed to assess the efficacy and safety of risankizumab (BI 655066, Boehringer Ingelheim, Ingelheim, Germany), a humanised monoclonal antibody targeting the p19 subunit of interleukin-23, in patients with moderately-to-severely active Crohn's disease. Methods In this randomised, double-blind, placebo-controlled phase 2 study, we enrolled patients at 36 referral sites in North America, Europe, and southeast Asia. Eligible patients were aged 18–75 years, with a diagnosis of Crohn's disease for at least 3 months, assessed as moderate-to-severe Crohn's disease at screening, defined as a Crohn's Disease Activity Index (CDAI) of 220–450, with mucosal ulcers in the ileum or colon, or both, and a Crohn's Disease Endoscopic Index of Severity (CDEIS) of at least 7 (≥4 for patients with isolated ileitis) on ileocolonoscopy scored by a masked central reader. Patients were randomised 1:1:1 using an interactive response system to a double-blind investigational product, and stratified by previous exposure to TNF antagonists (yes vs no). Patients received intravenous 200 mg risankizumab, 600 mg risankizumab, or placebo, at weeks 0, 4, and 8. The primary outcome was clinical remission (CDAI <150) at week 12 (intention-to-treat population). Safety was assessed in patients who received at least one dose of study drug. This study is registered with ClinicalTrials.gov, number NCT02031276. Findings Between March, 2014, and September, 2015, 213 patients were screened, and 121 patients randomised. At baseline, 113 patients (93%) had been previously treated with at least one tumour necrosis factor (TNF) antagonist (which had failed in 96 [79%]). At week 12, 25 (31%) of 82 risankizumab patients (pooled 41 patients in 200 mg and 41 patients in 600 mg arms) had clinical remission versus six (15%) of 39 placebo patients (difference vs placebo 15·0%, 95% CI 0·1 to 30·1; p=0·0489). Ten (24%) of 41 patients who received 200 mg risankizumab had clinical remission (9·0%, −8·3 to 26·2; p=0·31) and 15 (37%) of 41 who received the 600 mg dose (20·9%, 2·6 to 39·2; p=0·0252). 95 (79%) patients had adverse events (32 in the placebo group, 32 randomised to 200 mg risankizumab, 31 randomised to 600 mg risankizumab); 18 had severe adverse events (nine, six, three); 12 discontinued (six, five, one); 24 had serious adverse events (12, nine, three). The most common adverse event was nausea and most common serious adverse event was worsening of underlying Crohn's disease. No deaths occurred. Interpretation In this short-term study, risankizumab was more effective than placebo for inducing clinical remission in patients with active Crohn's disease. Therefore, selective blockade of interleukin-23 via inhibition of p19 might be a viable therapeutic approach in Crohn's disease. Funding Boehringer Ingelheim.