Background: Levoketoconazole is a ketoconazole stereoisomer in development for treatment of Cushing's syndrome and has not been assessed previously in a clinical trial in patients with Cushing's syndrome. We aimed to investigate the efficacy and safety of levoketoconazole in patients with endogenous Cushing's syndrome. Methods: SONICS is a phase 3, multicentre, open-label, non-randomised, single-arm study in which we recruited adults (≥18 years) with confirmed Cushing's syndrome and a mean 24-h urinary free cortisol (mUFC) of at least 1·5 times the upper limit of normal from 60 hospital and community sites in 19 countries (15 countries in Europe, and Canada, Israel, Turkey, and the USA). Patients were treated with oral levoketoconazole in a 2–21 week incremental dose-titration phase starting at 150 mg twice daily (150 mg increments until mUFC normalisation, maximum 600 mg twice daily) and a 6-month maintenance phase. The primary outcome was the proportion of patients with mUFC normalisation at end of maintenance, without dose increase during the maintenance phase (in the intention-to-treat population). Prespecified adverse events of special interest were potential liver toxicity, corrected QT prolongation, and adrenal insufficiency. This trial is registered with ClinicalTrials.gov, NCT01838551. Findings: Between July 30, 2014, and June 30, 2017, 201 individuals were screened and 94 patients were enrolled and received at least one dose of study medication. Of the 94 patients, 80 (85%) had pituitary Cushing's syndrome. Mean mUFC at baseline was 671·4 nmol/24 h (243·3 μg/24 h), which is 4·9 times the upper limit of normal. Of the 77 patients who advanced to the maintenance phase, 62 (81%) had mUFC normalisation by end-of-dose titration. At the end of the 6-month maintenance phase, 29 (31%) of 94 patients were responders; the least-squares mean estimate of the proportion of responders was 0·30 (95% CI 0·21–0·40; p=0·0154 vs null hypothesis of ≤0·20). The most common adverse events in the 94 patients were nausea (30 [32%]) and headache (26 [28%]). Adverse events led to study discontinuation in 12 (13%) of 94 patients. Two patients had a QT interval (Fridericia corrected) of more than 500 ms, and three patients had suspected adrenal insufficiency. Alanine aminotransferase reversibly increased to more than three times the upper limit of normal in ten (11%) patients. Four patients had serious adverse events that were considered probably or definitely related to the study drug: abnormal liver function test results (n=1), prolonged QT interval (n=2), and adrenal insufficiency (n=1). One person died from colon carcinoma unrelated to study medication. Interpretation: Twice-daily oral levoketoconazole treatment led to sustained improvements in urinary free cortisol, with an acceptable safety and tolerability profile. Levoketoconazole might represent a useful therapeutic option for the medical treatment of Cushing's syndrome. Funding: Strongbridge Biopharma.