Data assessing protection conferred from COVID-19 mRNA vaccination and/or prior SARS-CoV-2 infection during Delta and Omicron predominance periods in the U.S. are limited. This cohort study included persons ≥18 years who had ≥1 healthcare encounter across four health systems and had been tested for SARS-CoV-2 before August 26, 2021. COVID-19 mRNA vaccination and prior SARS-CoV-2 infection defined the exposure. Cox regression estimated hazard ratios (HRs) for the Delta and Omicron periods; protection was calculated as (1-HR)x100%. Compared to unvaccinated and previously uninfected persons, during Delta predominance, protection against COVID-19-associated hospitalizations was high for those 2- or 3-dose vaccinated and previously infected, 3-dose vaccinated alone, and prior infection alone (range:91%-97%, with overlapping 95% confidence intervals (95%CIs)); during Omicron predominance, estimates were lower (range:77%-90%). Protection against COVID-19-associated emergency department/urgent care (ED/UC) encounters during Delta predominance was high for those exposure groups (range:86%-93%); during Omicron predominance, protection remained high for those 3-dose vaccinated with or without a prior infection (76% (95%CI=67%-83%) and 71% (95%CI=67%-73%), respectively). COVID-19 mRNA vaccination and/or prior SARS-CoV-2 infection provided protection against COVID-19-associated hospitalizations and ED/UC encounters regardless of variant. Staying up-to-date with COVID-19 vaccination still provides protection against severe COVID-19 disease, regardless of prior infection.