Objective: Our aim was to explore the risk of infection with all classes of inflammatory bowel disease (IBD) medications and the impact of these medications on the disease course in a nationwide cohort of patients with IBD., Design: This was a retrospective national cohort study of patients with IBD in the Veterans Affairs Healthcare System. We categorised IBD medication use immediately prior to the COVID-19 pandemic and used survival analysis methods to study associations with SARS-CoV-2 infection, as well as a combined secondary outcome of COVID-19 hospitalisation or COVID-19-related mortality., Results: The analytical cohort of 30 911 patients was primarily male (90.9%), white (78.6%) and with ulcerative colitis (58.8%). Over a median follow-up of 10.7 months, 649 patients (2.1%) were diagnosed with SARS-CoV-2 infection and 149 (0.5%) met the combined secondary outcome. In adjusted models, vedolizumab (VDZ) use was significantly associated with infection relative to mesalazine alone (HR 1.70, 95% CI 1.16 to 2.48, p=0.006). Patients on no IBD medications had increased risk of the combined secondary outcome relative to mesalazine alone (sub-HR 1.64, 95% CI 1.12 to 2.42, p=0.01), however, no other IBD medication categories were significantly associated with this outcome, relative to mesalazine alone (each p>0.05). Corticosteroid use was independently associated with both SARS-CoV-2 infection (HR 1.60, 95% CI 1.23 to 2.09, p=0.001) and the combined secondary outcome (sub-HR 1.90, 95% CI 1.14 to 3.17, p=0.01)., Conclusion: VDZ and corticosteroid were associated with an increased risk of SARS-CoV-2 infection. Except for corticosteroids no medications including mesalazine were associated with an increased risk of severe COVID-19., Competing Interests: Competing interests: NK has received an unrestricted research grant from Pfizer, Luitpold and Takeda Pharmaceuticals as well as Samsung BioEpis. NM and CT have nothing to disclose regarding conflicts of interest. WR has served (1) as a speaker for Abbott Laboratories, Abbvie, Aesca, Aptalis, Astellas, Centocor, Celltrion, Danone Austria, Elan, Falk Pharma, Ferring, Immundiagnostik, Mitsubishi Tanabe Pharma Corporation, MSD, Otsuka, PDL, Pharmacosmos, PLS Education, Schering-Plough, Shire, Takeda, Therakos, Vifor, Yakult, (2) as a consultant for Abbott Laboratories, Abbvie, Aesca, Algernon, Amgen, AM Pharma, AMT, AOP Orphan, Arena Pharmaceuticals, Astellas, Astra Zeneca, Avaxia, Roland Berger, Bioclinica, Biogen IDEC, Boehringer-Ingelheim, Bristol-Myers Squibb, Cellerix, Chemocentryx, Celgene, Centocor, Celltrion, Covance, Danone Austria, DSM, Elan, Eli Lilly, Ernest & Young, Falk Pharma, Ferring, Galapagos, Genentech, Gilead, Grünenthal, ICON, Index Pharma, Inova, Intrinsic Imaging, Janssen, Johnson & Johnson, Kyowa Hakko Kirin Pharma, Lipid Therapeutics, LivaNova, Mallinckrodt, Medahead, MedImmune, Millenium, Mitsubishi Tanabe Pharma Corporation, MSD, Nash Pharmaceuticals, Nestle, Nippon Kayaku, Novartis, Ocera, OMass, Otsuka, Parexel, PDL, Periconsulting, Pharmacosmos, Philip Morris Institute, Pfizer, Procter & Gamble, Prometheus, Protagonist, Provention, Quell Tx, Robarts Clinical Trial, Sandoz, Schering-Plough, Second Genome, Seres Therapeutics, Setpointmedical, Sigmoid, Sublimity, Takeda, Therakos, Theravance, Tigenix, UCB, Vifor, Zealand, Zyngenia, and 4SC, (3) as an advisory board member for Abbott Laboratories, Abbvie, Aesca, Amgen, AM Pharma, Astellas, Astra Zeneca, Avaxia, Biogen IDEC, Boehringer-Ingelheim, Bristol-Myers Squibb, Cellerix, Chemocentryx, Celgene, Centocor, Celltrion, Danone Austria, DSM, Elan, Ferring, Galapagos, Genentech, Grünenthal, Inova, Janssen, Johnson & Johnson, Kyowa Hakko Kirin Pharma, Lipid Therapeutics, MedImmune, Millenium, Mitsubishi Tanabe Pharma Corporation, MSD, Nestle, Novartis, Ocera, Otsuka, PDL, Pharmacosmos, Pfizer, Procter & Gamble, Prometheus, Sandoz, Schering-Plough, Second Genome, Setpointmedical, Takeda, Therakos, Tigenix, UCB, Zealand, Zyngenia and 4SC, and (4) has received research funding from Abbott Laboratories, Abbvie, Aesca, Centocor, Falk Pharma, Immundiagnostik, MSD'. JDL has served as a consultant for Merck, AbbVie, Lilly, Janssen, Johnson & Johnson Consumer, and Takeda; has served on Data Safety Monitoring Boards for Pfizer, Gilead, and UCB; and has received research support from Takeda and Nestle Health Science., (© Author(s) (or their employer(s)) 2021. Re-use permitted under CC BY-NC. No commercial re-use. See rights and permissions. Published by BMJ.)