ImportanceDiabetes and COVID-19 are both global pandemics, and type 2 diabetes is a common comorbidity in patients with acute COVID-19 and is proven to be a key determinant of COVID-19 prognosis. Molnupiravir and nirmatrelvir-ritonavir are oral antiviral medications recently approved for nonhospitalized patients with mild to moderate COVID-19, following demonstration of their efficacies in reducing adverse outcomes of the disease; it is crucial to clarify whether both oral antiviral medications are efficacious in a population consisting exclusively of patients with type 2 diabetes.ObjectiveTo evaluate the effectiveness of molnupiravir and nirmatrelvir-ritonavir in a contemporary population-based cohort comprising exclusively nonhospitalized patients with type 2 diabetes and SARS-CoV-2 infection.Design, Setting, and ParticipantsThis retrospective cohort study was performed using population-based electronic medical record data for patients in Hong Kong with type 2 diabetes and confirmed SARS-CoV-2 infection between February 26 and October 23, 2022. Each patient was followed up until death, outcome event, crossover of oral antiviral treatment, or end of the observational period (October 30, 2022), whichever came first. Outpatient oral antiviral users were divided into molnupiravir and nirmatrelvir-ritonavir treatment groups, respectively, and nontreated control participants were matched through 1:1 propensity score matching. Data analysis was performed on March 22, 2023.ExposuresMolnupiravir (800 mg twice daily for 5 days) or nirmatrelvir-ritonavir (300 mg nirmatrelvir and 100 mg ritonavir twice daily for 5 days, or 150 mg nirmatrelvir and 100 mg ritonavir for patients with an estimated glomerular filtration rate of 30-59 mL/min per 1.73 m2).Main Outcomes and MeasuresThe primary outcome was a composite of all-cause mortality and/or hospitalization. The secondary outcome was in-hospital disease progression. Hazard ratios (HRs) were estimated with Cox regression.ResultsThis study identified 22 098 patients with type 2 diabetes and COVID-19. A total of 3390 patients received molnupiravir and 2877 received nirmatrelvir-ritonavir in the community setting. After application of exclusion criteria followed by 1:1 propensity score matching, this study comprised 2 groups. One group included 921 molnupiravir users (487 men [52.9%]), with a mean (SD) age of 76.7 (10.8) years, and 921 control participants (482 men [52.3%]), with a mean (SD) age of 76.6 (11.7) years. The other group included 793 nirmatrelvir-ritonavir users (401 men [50.6%]), with a mean (SD) age of 71.7 (11.5) years, and 793 control participants (395 men [49.8%]), with a mean (SD) age of 71.9 (11.6) years. At a median follow-up of 102 days (IQR, 56-225 days), molnupiravir use was associated with a lower risk of all-cause mortality and/or hospitalization (HR, 0.71 [95% CI, 0.64-0.79]; P < .001) and in-hospital disease progression (HR, 0.49 [95% CI, 0.35-0.69]; P < .001) compared with nonuse. At a median follow-up of 85 days (IQR, 56-216 days), nirmatrelvir-ritonavir use was associated with a lower risk of all-cause mortality and/or hospitalization (HR, 0.71 [95% CI, 0.63-0.80]; P < .001) and a nonsignificantly lower risk of in-hospital disease progression (HR, 0.92 [95% CI, 0.59-1.44]; P = .73) compared with nonuse.Conclusions and RelevanceThese findings suggest that both molnupiravir and nirmatrelvir-ritonavir oral antiviral medications were associated with a lower risk of all-cause mortality and hospitalization among patients with COVID-19 and type 2 diabetes. Further studies in specific populations, such as individuals in residential care homes and individuals with chronic kidney disease, are suggested.