We examined the effectiveness of maternal vaccination against SARS-CoV-2 infection in 30,311 infants born at Kaiser Permanente Northern California from December 15, 2020, to May 31, 2022. Using Cox regression, the effectiveness of ≥2 doses of COVID-19 vaccine received during pregnancy was 84% (95% confidence interval [CI]: 66, 93), 62% (CI: 39, 77) and 56% (CI: 34,71) during months 0-2, 0-4 and 0- 6 of a child’s life, respectively, in the Delta variant period. In the Omicron variant period, the effectiveness of maternal vaccination in these three age intervals was 21% (CI: -21,48), 14% (CI: -9,32) and 13% (CI: -3,26), respectively. Over the entire study period, the incidence of hospitalization for COVID-19 was lower during the first 6 months of life among infants of vaccinated mothers compared with infants of unvaccinated mothers (21/100,000 person-years vs. 100/100,000 person-years). Maternal vaccination was protective, but protection was lower during Omicron than during Delta. Protection during both periods decreased as infants aged.