Introduction The nirmatrelvir/ritonavir (PAXLOVIDTM) is an antiviral blocking the replication of SARS-CoV-2. Early treatment with this antiviral has showed to reduce COVID-19 hospitalization and death in unvaccinated outpatients with mild-to-moderate COVID-19 and high risk of progression to severe disease with variants before Omicron. However, the current epidemiological context and the level of immunity in the population (vaccination and/or natural infection) have evolved considerably since the disclosure of these results. Thus, real-world evidence studies in vaccinated outpatients with lineage and sublineage of the variant are needed. Objective To assess whether nirmatrelvir/ritonavir treatment reduces the risk of COVID-19-associated hospitalization among Québec outpatients with mild-to-moderate COVID-19 at high risk of progression to severe disease in a real-world context, regardless of vaccination status and circulating variants, in the province of Québec. Methods This was a retrospective cohort study of SARS-CoV-2-infected outpatients who received nirmatrelvir/ritonavir between March 15 and August 15, 2022, using data from the Québec provincial clinico-administrative databases. Outpatients treated with nirmatrelvir/ritonavir were compared to unexposed ones. The treatment group was matched with controls using propensity-score matching in a ratio of 1:1. The outcome was COVID-19-associated hospitalization occurring within 30 days following the index date. Poisson regression with robust error variance was used to estimate the relative risk of hospitalization among the treatment group compared to the control group. Results A total of 16,601 and 242,341 outpatients were eligible to be included in the treatment (nirmatrelvir/ritonavir) and control groups respectively. Among treated outpatients, 8,402 were matched to controls. Regardless of vaccination status, nirmatrelvir/ritonavir-treated outpatient status was associated with a 69% reduced relative risk of COVID-19-associated hospitalization (RR: 0.31 [95% CI: 0.28; 0.36]). The effect was more pronounced in outpatients without a complete primary vaccination course (RR: 0.04 [95% CI: 0.03; 0.06]), while treatment with nirmatrelvir/ritonavir was not associated with benefit when outpatients with a complete primary vaccination course were considered (RR: 0.93 [95% CI: 0.78; 1.08]) Subgroups analysis among outpatients with a primary vaccination course showed that nirmatrelvir/ritonavir treatment was associated with a significant decrease in relative risk of hospitalization in severely immunocompromised outpatients (RR: 0.66 [95% CI: 0.50; 0.89]) and in outpatients aged 70 years and older (RR: 0.50 [95% CI: 0.34; 0.74]) when the last dose of the vaccine was received more than six months before. Conclusions Among SARS-CoV-2 infected outpatients at high risk for severe COVID-19 during Omicron BA.2 and BA.4/5 surges, treatment with nirmatrelvir/ritonavir was associated with a significant reduced relative risk of COVID-19-associated hospitalization. This effect was observed in outpatients with incomplete primary vaccination course and in outpatients who were severely immunocompromised. Except for severely immunocompromised outpatients, no evidence of benefit was found in any category of outpatient with a complete primary vaccination course whose last dose of COVID-19 vaccine was received within six months.