The global pandemic of COVID-19 is colliding with the epidemic of opioid use disorders (OUD) and other substance use disorders (SUD) in the United States (US). Currently, there is limited data on risks, disparity, and outcomes for COVID-19 in individuals suffering from SUD. This is a retrospective case-control study of electronic health records (EHRs) data of 73,099,850 unique patients, of whom 12,030 had a diagnosis of COVID-19. Patients with a recent diagnosis of SUD (within past year) were at significantly increased risk for COVID-19 (adjusted odds ratio or AOR = 8.699 [8.411-8.997], P < 10 −30), an effect that was strongest for individuals with OUD (AOR = 10.244 [9.107-11.524], P < 10 −30), followed by individuals with tobacco use disorder (TUD) (AOR = 8.222 ([7.925-8.530], P < 10 −30). Compared to patients without SUD, patients with SUD had significantly higher prevalence of chronic kidney, liver, lung diseases, cardiovascular diseases, type 2 diabetes, obesity and cancer. Among patients with recent diagnosis of SUD, African Americans had significantly higher risk of COVID-19 than Caucasians (AOR = 2.173 [2.01-2.349],