ImportanceInfants younger than 6 months are at risk of severe SARS-CoV-2 infection. Data are lacking on the optimum timing for maternal vaccination and estimated effectiveness against Omicron variants, including XBB, for infants.ObjectiveTo investigate maternal vaccination against Omicron variants, including XBB, and the association of vaccination timing during pregnancy vs prior to pregnancy and risks of SARS-CoV-2 infection among infants aged 6 months or younger.Design, Setting, and ParticipantsThis population-based cohort study was conducted between January 1, 2022, and March 31, 2023. Singapore’s national dataset was used to study infants born at greater than 32 weeks’ gestation between January 1, 2022, and September 30, 2022. The study included infants whose parents had a confirmed SARS-CoV-2 infection from the date of birth up to 6 months of age. Of 21 609 infants born during this period, 7292 (33.7%) had at least 1 parent infected with SARS-CoV-2 before the age of 7 months. Statistical analysis was performed from April to July 2023.ExposureInfants’ mothers were unvaccinated, vaccinated prior to pregnancy, or vaccinated with a messenger RNA (mRNA) SARS-CoV-2 vaccine during pregnancy.Main Outcome and MeasureInfants were considered infected if they had a positive polymerase chain reaction test.ResultsAmong 7292 infants included in this study, 4522 (62.0%) had mothers who were Chinese, 527 (7.2%) had mothers who were Indian, 2007 (27.5%) had mothers who were Malay, and 236 (3.2%) had mothers who were other ethnicity; 6809 infants (93.4%) were born at full term, and 1272 infants (17.4%) were infected during the study period. There were 7120 infants (97.6%) born to mothers who had been fully vaccinated or boosted as of 14 days prior to delivery. The crude incidence rate was 174.3 per 100 000 person-days among infants born to mothers who were unvaccinated, 122.2 per 100 000 person-days among infants born to mothers who were vaccinated before pregnancy, and 128.5 per 100 000 person-days among infants born to mothers who were vaccinated during pregnancy. The estimated vaccine effectiveness (VE) was 41.5% (95% CI, 22.8% to 55.7%) among infants born to mothers vaccinated during pregnancy. Infants of mothers who received vaccination prior to pregnancy did not have a lower risk for infection (estimated VE, 15.4% [95% CI, −17.6% to 39.1%]). A lower risk for Omicron XBB infection was only observed among mothers vaccinated with the third (booster) dose antenatally (estimated VE, 76.7% [95% CI, 12.8% to 93.8%]).Conclusions and RelevanceIn this population-based cohort study, maternal mRNA vaccination was associated with a lower risk of Omicron SARS-CoV-2 infection among infants up to 6 months of age only if the vaccine was given during the antenatal period. These findings suggest that mRNA vaccination during pregnancy may be needed for lower risk of SARS-CoV-2 infection among newborns.