ObjectivesAmong people receiving opioid-agonist treatment (OAT), the risk of COVID-19 infection and disease may be higher owing to underlying health problems and vulnerable social circumstances. We aimed to determine whether recent OAT, when compared with past exposure, affected the risk of (i) testing for SARS-CoV-2, (ii) testing positive for SARS-CoV-2, and (iii) being hospitalized or dying with COVID-19 disease. MethodsWe included individuals prescribed OAT in Scotland from 2015 to 2020. We performed record linkage to SARS-CoV-2 PCR testing, vaccination, hospitalization, and mortality data, and followed up from March 2020 to December 2021. We used proportional hazards analysis and multivariate logistic regression to estimate associations between recent OAT prescription (in the previous 2 months), compared with past exposure (off treatment for over a year), and COVID-19 outcomes. Models were adjusted for confounders. ResultsAmong 36 093 individuals prescribed OAT, 19 071 (52.9%) were tested for SARS-CoV-2; 2896 (8.3%) tested positive; and 552 (1.5%) were hospitalized or died with COVID-19. Recent OAT, compared with past exposure, was associated with lower odds of testing positive among those tested (aOR, 0.63; 95% CI, 0.57–0.69). However, among those testing positive, recent OAT was associated with two-fold higher odds of hospitalization or death (aOR, 2.04; 95% CI, 1.60–2.59). DiscussionWe found that recent OAT was associated with lower odds of SARS-CoV-2 infection, but with higher odds of disease once diagnosed. Clinical studies are needed to unravel the role of OAT in these associations. An enhanced effort is warranted to increase vaccine coverage among OAT patients to mitigate the severe consequences of COVID-19.