Importance: More than half of patients with alcohol use disorder who receive inpatient withdrawal treatment relapse within weeks of discharge, hampering subsequent uptake and effectiveness of psychological and pharmacologic interventions. Cognitive bias modification (CBM) improves outcomes after alcohol rehabilitation, but the efficacy of delivering CBM during withdrawal treatment has not yet been established. Objective: To test the hypothesis that CBM would increase the likelihood of abstaining from alcohol during the 2 weeks following discharge from inpatient withdrawal treatment. Design, Setting, and Participants: In a randomized clinical trial, 950 patients in 4 inpatient withdrawal units in Melbourne, Australia, were screened for eligibility between June 4, 2017, and July 14, 2019, to receive CBM or sham treatment. Patients with moderate or severe alcohol use disorder aged 18 to 65 years who had no neurologic illness or traumatic brain injury were eligible. Two-week follow-up, conducted by researchers blinded to the participant's condition, was the primary end point. Both per-protocol and intention-to-treat analysis were conducted. Interventions: Randomized to 4 consecutive daily sessions of CBM designed to reduce alcohol approach bias or sham training not designed to modify approach bias. Main Outcomes and Measures: Primary outcome was abstinence assessed using a timeline followback interview. Participants were classified as abstinent (no alcohol use in the first 14 days following discharge) or relapsed (any alcohol use during the first 14 days following discharge or lost to follow-up). Results: Of the 950 patients screened for eligibility, 338 did not meet inclusion criteria, 108 were discharged before being approached, and 192 refused. Of the 312 patients who consented (referred sample), 12 withdrew before being randomized. In the final population of 300 randomized patients (CBM, n = 147; sham, n = 153), 248 completed the intervention and 272 completed the follow-up. Of the 300 participants (173 [57.7%] men; mean [SD] age, 43.47 [10.43] years), 7 patients (3 controls, 4 CBM) withdrew after finding the training uncomfortable. Abstinence rates were 42.5% (95% CI, 34.3%-50.6%) in controls and 54.4% (95% CI, 46.0%-62.8%) in CBM participants, yielding an 11.9% (95% CI, 0.04%-23.8%; P =.04) difference in abstinence rates. In a per-protocol analysis including only those who completed 4 sessions of training and the follow-up, the difference in abstinence rate between groups was 17.0% (95% CI, 3.8%-30.2%; P =.008). Conclusions and Relevance: The findings of this clinical trial support the efficacy of CBM for treatment of alcohol use disorder. Being safe and easy to implement, requiring only a computer and joystick, and needing no specialist staff/training, CBM could be routinely offered as an adjunctive intervention during withdrawal treatment to optimize outcomes. Trial Registration: Australian New Zealand Clinical Trials Registry Identifier: ACTRN12617001241325.