Introduction

Immune imprinting, broadly defined as the phenomenon in which a specific sequence of immunological events—arising from infection and/or vaccination—can either enhance or compromise an individual’s future immune protection against infection and severe disease, is an intriguing and debated concept, characterized by seemingly contradictory findings and inadequate exploration1,2,3,4,5. An indication of the limitations in understanding this phenomenon is the current inability to confidently predict whether a particular immune history will provide superior or inferior protection against future infection. For instance, there has been intense discussion on how first-generation coronavirus disease 2019 (COVID-19) vaccines should be updated and whether a bivalent strategy (including both the ancestral and current viruses) or a monovalent strategy (including only current virus) should be adopted6,7,8,9,10.

An understanding of how different immune histories affect protection against infection and severe disease can provide insights into the fundamental mechanisms of immunity, inform the development of effective vaccines, and optimize vaccine impact by tailoring strategies to specific populations1,2,3,4,5,6,7,8,9,10,11. This is particularly important in cases where an infection is already endemic, and the population has heterogeneous immune histories due to varying exposures to infection, variants, and vaccination1. Investigating how different immune histories affect protection can be approached at both molecular and population levels, as has been done in studies of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) infection1,2,3,4,5,12,13.

Building on this line of research, particularly in exploring immune history effects at the population level for hypothesis generation4,5,12,13, we conducted three national, matched, retrospective cohort studies to examine how different natural infection histories, with or without vaccination, in addition to an omicron infection, may influence protection against subsequent omicron reinfection. The findings show that individuals with immunity from both pre-omicron and omicron infections, or from a single omicron infection, have greater protection against subsequent omicron reinfection than those with two omicron infections, suggesting that repeated exposure to the same immunological event may reduce protection against emerging variants.

Methods

Study population, data sources, and vaccination

This study comprised Qatar’s resident population between February 28, 2020, the date of the first documented SARS-CoV-2-positive test, and August 12, 2024, the study’s end date. Data on COVID-19 laboratory testing, vaccination, hospitalization, and death were sourced from Qatar’s national integrated digital health information platform (Supplementary Methods). This platform captures all SARS-CoV-2-related data, including COVID-19 vaccinations, hospitalizations, and polymerase chain reaction (PCR) and medically supervised rapid-antigen tests, irrespective of location or facility (Supplementary Methods).

Qatar’s testing program was extensive, with most infections identified through routine testing rather than symptomatic presentation (Supplementary Methods)14,15. COVID-19 vaccinations, comprising generally mRNA vaccines16,17,18, were provided free of charge to all individuals, irrespective of citizenship status, exclusively through the public healthcare system19. The vaccination strategy prioritized frontline healthcare workers, individuals with severe or multiple chronic conditions, and individuals aged over 50 years14. Due to the very low coverage of omicron-based vaccines in Qatar18, vaccination in this study predominantly refers to the original first-generation vaccines targeting the original virus.

Demographic data were obtained from the national health registry. Qatar’s demographic structure is distinct. Only 9% of the population are over 50 years and 89% are resident expatriates from over 150 countries20. Further details on Qatar’s population and COVID-19 databases have been previously published12,14,15,20,21,22,23.

Study design

Three national, matched, retrospective cohort studies were conducted, informed by our earlier cohort studies on Qatar’s population4,5,12,13,21,24,25,26,27,28, to investigate how different natural infection and vaccination histories before an omicron infection may affect protection against subsequent reinfection with omicron variants.

The first study compared the incidence of reinfection and of severe, critical, or fatal COVID-19 upon reinfection between the national cohort of individuals with a primary omicron infection followed by an omicron reinfection (omicron double-infection cohort) and the national cohort of individuals with only a primary omicron infection (omicron single-infection cohort) (Fig. 1a).

Fig. 1: Study design. Schematic diagram illustrating the study design for comparing the incidence of SARS-CoV-2 reinfection across study cohorts.
figure 1

Study design for the analysis comparing incidence of reinfection between a the omicron double-infection cohort and the omicron single-infection cohort, b the omicron double-infection cohort and the pre-omicron-omicron double-infection cohort, and c the pre-omicron-omicron double-infection cohort and the omicron single-infection cohort.

The second study compared these outcomes between the omicron double-infection cohort and the national cohort of individuals with a primary pre-omicron infection followed by an omicron reinfection (pre-omicron-omicron double-infection cohort) (Fig. 1b). The third study compared these outcomes between the pre-omicron-omicron double-infection cohort and the omicron single-infection cohort (Fig. 1c).

Incidence of reinfection was defined as a SARS-CoV-2-positive test after the start of follow-up. Severity of reinfections was determined by trained medical personnel independent of study investigators, based on individual chart reviews. These assessments followed the World Health Organization’s (WHO) guidelines for defining COVID-19 severity29, criticality29, and fatality30 (Supplementary Methods)31.

Cohorts’ matching

Cohorts were matched exactly one-to-one by sex, 10-year age group, nationality, number of coexisting conditions (Supplementary Methods), number of vaccine doses, and vaccine type, as ascertained at the start of follow-up. Matching was also performed based on the testing method (PCR versus rapid-antigen testing), reason for testing, and calendar week of the SARS-CoV-2 test that defined reinfection for the omicron double-infection cohort, reinfection for the pre-omicron-omicron double-infection cohort, and primary infection for the omicron single-infection cohort. Matching by calendar time ensured that matched pairs were concurrently present in Qatar. This comprehensive matching strategy, informed by prior studies on Qatar’s population4,5,12,13,21,24,25,26,27,28, ensured balance of confounders across study cohorts.

Iterative matching was implemented to ensure that, at the start of follow-up, individuals were alive and had the same vaccine type and number of doses as their match. Further details can be found in Supplementary Methods.

Cohorts’ follow-up

Follow-up started from 90 days after the reinfection for individuals in the omicron double-infection cohort in the studies comparing this cohort to either the omicron single-infection cohort or the pre-omicron-omicron double-infection cohort. Similarly, follow-up was from 90 days after the reinfection for individuals in the pre-omicron-omicron double-infection cohort in the study comparing this cohort to the omicron single-infection cohort.

The 90-day cutoff, consistent with the conventional definition of SARS-CoV-2 reinfection as a documented infection occurring ≥90 days after a previous infection, avoids misclassifying prolonged test positivity as reinfection32,33,34,35.

For exchangeability21,36, both members of each matched pair were censored at the earliest occurrence of receiving an additional vaccine dose. Accordingly, individuals were followed until the first of any of the following events: a documented SARS-CoV-2 reinfection (irrespective of symptoms), a new vaccine dose (with matched-pair censoring), death, or the administrative end of follow-up at the end of the study.

Variant ascertainment

The duration of dominance of each SARS-CoV-2 variant (Supplementary Fig. 1) was determined based on Qatar’s variant genomic surveillance37,38,39. This surveillance program comprised viral genome sequencing37 and multiplex real-time reverse-transcription PCR (RT-qPCR) variant screening38 performed on weekly collected random positive clinical samples (Supplementary Methods).

Ethics

The institutional review boards at Hamad Medical Corporation (reference number: MRC–01–20–1078) and Weill Cornell Medicine–Qatar (reference number: 20–00017) approved this retrospective study with a waiver of informed consent. The study was reported according to the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE; Supplementary Table 1).

Statistical analysis

Matched cohorts were characterized through descriptive statistics and compared using standardized mean differences (SMDs). An SMD of ≤0.1 indicated adequate matching40. Cumulative incidence of reinfection, defined as proportion of individuals at risk with reinfection as a primary endpoint during follow-up, was estimated using the Kaplan–Meier estimator method. Cumulative incidence was reported unadjusted to provide a direct and intuitive representation of the observed data, and adjusted estimates were also provided in a sensitivity analysis. Schoenfeld residuals and log-log plots for survival curves were used to examine the proportional-hazards assumption.

Incidence rate of reinfection, defined as number of individuals with reinfection in a cohort divided by number of person-weeks contributed by all individuals in the cohort, was estimated, with the associated 95% confidence interval (CI), using a Poisson log-likelihood regression model.

Adjusted hazard ratios (aHRs) comparing the incidence of reinfection between study cohorts, along with the corresponding 95% CIs, were calculated using Cox regression models. These models were adjusted for matching factors to ensure unbiased estimation of the standard variance41, as well as for SARS-CoV-2 testing rates. To explore differences in the risk of reinfection over time, aHRs were also estimated by 6-month intervals from the start of follow-up using separate Cox regressions, with failure (reinfection) restricted to specific time intervals.

A subgroup analysis was performed by estimating the aHRs stratified by vaccination status. CIs were not adjusted for multiplicity, and interactions were not investigated, except in sensitivity analysis.

The conceptual approach of this study involved constructing matched cohorts from distinct full-cohort samples in a way that allowed their disaggregation into separate substudies for unvaccinated and vaccinated individuals, enabling the assessment of study outcomes within these subgroups. To confirm these results, a sensitivity analysis was conducted, where the same study outcomes for these subgroups were calculated using interaction terms between study cohorts and vaccination status. Cox interaction models were applied to the full cohorts to evaluate these interactions.

Statistical analyses were performed using Stata/SE version 18.0 (Stata Corporation, College Station, TX, USA).

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Results

Omicron double-infection cohort and omicron single-infection cohort

Figure 1a schematizes the study design. Supplementary Fig. 2 details the cohorts’ selection process. Supplementary Data 1 describes the matched cohorts’ baseline characteristics, each comprising 11,185 individuals. Supplementary Fig. 3A depicts the median dates of immunological events occurring before or after the start of follow-up among individuals who experienced these events within these analyzed cohorts.

The median duration between the two infections that define the omicron double-infection cohort was 309 days (interquartile range [IQR]: 239–474 days). Among vaccinated individuals, the median date of the first vaccine dose was March 22, 2021 (IQR: February 23, 2021–May 20, 2021) in the omicron double-infection cohort and April 7, 2021 (IQR: February 28, 2021–May 30, 2021) in the omicron single-infection cohort.

During follow-up, 675 reinfections were documented in the omicron double-infection cohort and 498 in the omicron single-infection cohort (Supplementary Fig. 2). Supplementary Table 2 presents the distribution of these reinfections by omicron subvariant. None of these reinfections progressed to severe, critical, or fatal COVID-19. Cumulative incidence of reinfection was 8.9% (95% CI: 8.2–9.6%) for the omicron double-infection cohort and 6.5% (95% CI: 6.0–7.2%) for the omicron single-infection cohort, after 660 days of follow-up (Fig. 2a and Supplementary Data 2). Supplementary Fig. 4A provides the cumulative incidence of reinfection stratified by vaccination status.

Fig. 2: Incidence of SARS-CoV-2 reinfection.
figure 2

Cumulative incidence in the studies comparing the incidence of SARS-CoV-2 reinfection between a the omicron double-infection cohort and the omicron single-infection cohort, b the omicron double-infection cohort and the pre-omicron-omicron double-infection cohort, and c the pre-omicron-omicron double-infection cohort and the omicron single-infection cohort.

The aHR comparing the incidence of reinfection in the omicron double-infection cohort to that in the omicron single-infection cohort was 1.27 (95% CI: 1.13–1.43; Table 1a) and appeared stable over the follow-up period (Supplementary Fig. 5A). In the subgroup analysis by vaccination status, the aHR was 0.93 (95% CI: 0.68–1.28) for the unvaccinated group and 1.34 (95% CI: 1.18–1.52) for the vaccinated group (Fig. 3a, Supplementary Table 3A, and Supplementary Data 3). The aHR was similar for those who received only primary-series vaccination and those who received three or more doses (Supplementary Table 3A).

Table 1 Hazard ratios for the incidence of SARS-CoV-2 reinfection
Fig. 3: Subgroup analysis. SARS-CoV-2 reinfection risk, stratified by vaccination status.
figure 3

Hazard ratios for the incidence of SARS-CoV-2 reinfection in the studies comparing the incidence of SARS-CoV-2 reinfection between a the omicron double-infection cohort and the omicron single-infection cohort, b the omicron double-infection cohort and the pre-omicron-omicron double-infection cohort, and c the pre-omicron-omicron double-infection cohort and the omicron single-infection cohort. Error bars indicate the corresponding 95% confidence intervals.

Omicron double-infection cohort and pre-omicron-omicron double-infection cohort

Figure 1b schematizes the study design. Supplementary Fig. 6 details the cohorts’ selection process. Supplementary Data 1 describes the matched cohorts’ baseline characteristics, each comprising 3573 individuals. Supplementary Fig. 3B depicts the median dates of immunological events occurring before or after the start of follow-up among individuals who experienced these events within these analyzed cohorts.

The median duration between the two infections that define the omicron double-infection cohort was 282 days (IQR: 222–455 days). The median duration between the two infections that define the pre-omicron-omicron double-infection cohort was 698 days (IQR: 521–876 days). Among vaccinated individuals, the median date of the first vaccine dose was March 23, 2021 (IQR: February 24, 2021–May 19, 2021) in the omicron double-infection cohort and April 20, 2021 (IQR: March 4, 2021–June 3, 2021) in the pre-omicron-omicron double-infection cohort.

During follow-up, 268 reinfections were documented in the omicron double-infection cohort and 185 in the pre-omicron-omicron double-infection cohort (Supplementary Fig. 6). Supplementary Table 2 presents the distribution of these reinfections by omicron subvariant. None of these reinfections progressed to severe, critical, or fatal COVID-19. Cumulative incidence of reinfection was 10.1% (95% CI: 9.0–11.3%) for the omicron double-infection cohort and 7.0% (95% CI: 6.1–8.1%) for the pre-omicron-omicron double-infection cohort, after 660 days of follow-up (Fig. 2b and Supplementary Data 2). Supplementary Fig. 4B provides the cumulative incidence of reinfection stratified by vaccination status.

The aHR comparing incidence of reinfection in the omicron double-infection cohort to that in the pre-omicron-omicron double-infection cohort was 1.37 (95% CI: 1.13–1.65; Table 1b) and appeared stable over the follow-up period (Supplementary Fig. 5B). In the subgroup analysis by vaccination status, the aHR was 1.12 (95% CI: 0.63–1.97) for the unvaccinated group and 1.42 (95% CI: 1.16–1.74) for the vaccinated group (Fig. 3b, Supplementary Table 3B, and Supplementary Data 3). The aHR was similar for those who received only primary-series vaccination and those who received three or more doses (Supplementary Table 3B).

Pre-omicron-omicron double-infection cohort and omicron single-infection cohort

Figure 1c schematizes the study design. Supplementary Fig. 7 details the cohorts’ selection process. Supplementary Data 1 describes the matched cohorts’ baseline characteristics, each comprising 37,771 individuals. Supplementary Fig. 3C depicts the median dates of immunological events occurring before or after the start of follow-up among individuals who experienced these events within these analyzed cohorts.

The median duration between the two infections that define the pre-omicron-omicron double-infection cohort was 435 days (IQR: 292–567 days). Among vaccinated individuals, the median date of the first vaccine dose was April 27, 2021 (IQR: March 14, 2021–May 31, 2021) in the pre-omicron-omicron double-infection cohort and April 13, 2021 (IQR: March 8, 2021–May 27, 2021) in the omicron single-infection cohort.

During follow-up, 2784 reinfections were documented in the pre-omicron-omicron double-infection cohort and 2726 in the omicron single-infection cohort (Supplementary Fig. 7). Supplementary Table 2 presents the distribution of these reinfections by omicron subvariant. None of these reinfections progressed to severe, critical, or fatal COVID-19. Cumulative incidence of reinfection was 8.9% (95% CI: 8.5–9.2%) for the pre-omicron-omicron double-infection cohort and 8.7% (95% CI: 8.4–9.0%) for the omicron single-infection cohort, after 840 days of follow-up (Fig. 2c and Supplementary Data 2). Supplementary Fig. 4C provides the cumulative incidence of reinfection stratified by vaccination status.

The aHR comparing incidence of reinfection in the pre-omicron-omicron double-infection cohort to that in the omicron single-infection cohort was 0.97 (95% CI: 0.92–1.03; Table 1c) and appeared stable over the follow-up period (Supplementary Fig. 5C). In the subgroup analysis by vaccination status, the aHR was 0.75 (95% CI: 0.66–0.85) for the unvaccinated group and 1.03 (95% CI: 0.97–1.09) for the vaccinated group (Fig. 3c, Supplementary Table 3C, and Supplementary Data 3). The aHR was similar for those who received only primary-series vaccination and those who received three or more doses (Supplementary Table 3C).

Additional analyses

The sensitivity analysis generating the adjusted cumulative incidence (Supplementary Fig. 8) produced incidence curves that closely resembled those observed in the main unadjusted analysis.

The sensitivity analysis, which estimated study outcomes for unvaccinated and vaccinated subgroups using interaction terms, confirmed similar results (Supplementary Fig. 9) and demonstrated evidence of interaction, with effects being modified by vaccination status (p-value < 0.001 for all three cohort analyses).

Discussion

Although the most recent immunological event in the investigated cohorts was an omicron infection, the incidence of subsequent infections varied based on prior infection histories (Fig. 2) and differed between vaccinated and unvaccinated subgroups (Fig. 3). The varying levels of protection associated with different immunological histories may be linked to the memory component of the immune response4,10,12, considering that antibody-mediated protection from vaccines and natural infections tends to wane rapidly11,14,27,42,43,44,45,46,47. These findings underscore the need for further investigation into these phenomena, including controlled experimental studies both in vitro and in vivo, to elucidate the biological mechanisms underlying the observed population-level effects.

The identified immune history effects at the population level complement those observed earlier4,5,12. In previous research, we found that a hybrid of pre-omicron and omicron immunity, whether from infection or vaccination, was associated with enhanced protection against future omicron reinfection, possibly due to the broadening of the immune response, exposure to more immunological events, and higher antibody titers4,5. We also found that repeated sequential immunological events of the same kind were associated with reduced protection against a new type of immunological event4,12.

The study findings overall align with these general patterns. A history of two sequential omicron infections after vaccination was associated with reduced protection compared to having only one omicron infection following vaccination (Fig. 3a). Additionally, two sequential omicron infections after vaccination conferred less protection than one omicron infection following an earlier pre-omicron infection and vaccination (Fig. 3b). A single omicron infection following vaccination appeared to provide comparable protection to that of one omicron infection following an earlier pre-omicron infection and vaccination (Fig. 3c). Finally, consistent with our previous study5, an omicron infection after a pre-omicron infection, in the absence of vaccination, offered greater protection than a history of only one omicron infection (Fig. 3c).

This study focused on the impact of immune history on protection against infection, but the nature of the variant challenge can also influence these effects. For example, our earlier studies suggested that specific immune history effects were more pronounced when the infection challenge involved the BA.5 variant4,5,12. Differences in the protection conferred by different immune histories often appear to result from a mismatch between specific immune memory and a substantially different immune challenge4,10,12. However, due to the size of the study cohorts, it was not possible to stratify the analysis by the dominant variant at each time point. As a result, the specific role of the variant challenge in shaping protection against infection remains an area for further investigation. Additionally, the cohort size restricted our ability to examine how the timing or the order of a sequence of immunological events impacts protection against infection and contributes to the observed effects.

Although we intended to investigate the impact of different immune histories on protection against severe COVID-19 outcomes, the lack of severe cases among the study cohorts rendered this analysis infeasible. Although some COVID-19 patients were hospitalized, none met the WHO criteria for severe or critical COVID-19, and there were no COVID-19-related deaths after the longitudinal review of their individual charts. This outcome aligns with the generally milder nature of omicron variants31,48,49, the more robust and slowly waning protection against severe disease conferred by natural infection and vaccination compared to protection against infection11,12,14,15,27,42,43,44,47,50,51, and the possibility that viral mutations optimizing immune escape may be associated with reduced virulence52,53.

This study has limitations. As an observational study, the investigated cohorts were neither blinded nor randomized, making it not possible to rule out unmeasured or uncontrolled confounding. Since the compared cohorts had different immune histories—some more protective than others—conditioning on these histories may introduce a collider bias54,55. Furthermore, the timing between prior exposures varied across the studied cohorts in the three analyses, potentially serving as an additional marker of exposure not fully accounted for by the covariates matched and adjusted for in this study.

A thorough examination of potential bias in this type of study design for assessing immune history effects, particularly the possibility of collider bias, suggests that such bias is not likely to have an appreciable impact or explain the observed results56. This conclusion is supported by the use of rigorous exact matching to balance infection risk across cohorts, aimed at equalizing the propensity for infection and informed by knowledge of SARS-CoV-2 epidemiology within this specific population56. Moreover, study estimates were adjusted for testing frequency, a key factor influencing variations in the propensity for documented infection56. The presented analyses are also part of a broader series investigating immune history effects4,5,12,13, and the overall findings from this series are inconsistent with the presence of an appreciable collider bias56. Instead, the results support the conclusion that, if such bias exists, its impact is marginal and mitigated by the study design.

The rigorous matching algorithm employed in this study ensures comparability between the study cohorts by accounting for observable factors that could influence infection risk20,57,58,59,60. While this approach enhances internal validity, it may limit generalizability due to the reduced cohort size. The smaller cohort size also restricts the ability to conduct additional subgroup analyses or precisely estimate effects, such as those based on the number of vaccine doses or vaccine types.

Each cohort was compared to the other two in separate analyses, leading to slight variations in cohort composition due to the matching process. These differences affected cohort demographics, follow-up times, and cumulative incidence rates across comparisons. For instance, the cumulative incidence in the omicron double-infection cohort differed between the two comparisons (8.9% versus 10.1%) due to variations in cohort composition and follow-up times.

Although the matching process accounted for key infection risk factors20,57,58,59,60, data limitations prevented matching on geography or occupation. Certain populations may have specific occupational risks that were not adjusted for, such as healthcare workers, who were also prioritized for vaccination over other population groups. However, healthcare workers constitute a very small proportion of Qatar’s population. Moreover, Qatar is essentially a city-state where nationality, age, and sex serve as effective proxies for socio-economic status and occupation20,57,58,59,60.

It is not likely that health conditions, weaker immune systems, or genetic factors could account for the results, as the matching process included multiple coexisting conditions and nationality, the latter possibly serving as a partial proxy for genetic factors. Furthermore, Qatar’s population is predominantly young and largely consists of healthy, working-age migrants, with only a very small proportion of elderly individuals who are more likely to have weaker immune systems14,20,23. The observed effects were sizable in magnitude in comparison, making it unlikely that these factors could explain the findings.

Given Qatar’s relatively young and healthy population20,23, the study findings may not be generalizable to countries with a larger elderly or comorbid population. Documented SARS-CoV-2 infections do not capture all infections that have occurred within the population. However, since under-ascertainment likely affected the study cohorts similarly, the impact on the study estimates—based on relative comparisons between the cohorts—may be mitigated.

The study has strengths. It was conducted on a national scale, encompassing a diverse population with a range of national backgrounds, and leveraged extensive, validated databases established through numerous SARS-CoV-2 infection studies. Exact matching was employed to ensure rigorous pairing of individuals across the cohorts. The matching methodology had been validated in previous studies with various epidemiological designs and tested with control groups to confirm null effects14,17,19,42,61. These studies demonstrated that this approach effectively controls for differences in infection exposure14,17,19,42,61.

In conclusion, protection against subsequent omicron reinfection appears to vary based on prior infection and vaccination histories. The findings support the concept that immunity involving both pre-omicron and omicron exposures provides enhanced protection, whereas repeated sequential exposures to the same immunological event reduce protection against new variants. These findings highlight the need for further investigation into the biological mechanisms underlying the observed differences in protection against infection. Controlled experimental studies are essential to better understand how different immunological histories shape immune responses to future variants.