Data from different countries show partly controversial impact of SARS-CoV-2 infection on pregnancy outcomes. A nationwide register-based study was conducted in Estonia to assess the impact of SARS-CoV-2 infection at any time during pregnancy on stillbirth, perinatal mortality, Apgar score at 5 minutes, cesarean section rates, rates of preterm birth and preeclampsia. Data on all newborns and their mothers were obtained from the Estonian Medical Birth Registry, and data on SARS-CoV-2 testing dates, test results and vaccination dates against SARS-CoV-2 from the Estonian Health Information System. Altogether, 26 211 births in 2020 and 2021 in Estonia were included. All analyses were performed per newborn. Odds ratios with 95% confidence intervals (CI) were analyzed for all outcomes, adjusted for mother's place of residence, body mass index, age of mother at delivery and hypertension and for all the aforementioned variables together with mother's vaccination status using data from 2021 when vaccinations against SARS-CoV-2 became available. For studying the effect of a positive SARS-CoV-2 test during pregnancy on preeclampsia, hypertension was omitted from the models to avoid overadjustment. SARS-CoV-2 infection during pregnancy was associated with an increased risk of stillbirth (adjusted odds ratio [aOR] 2.81; 95% CI 1.37-5.74) and perinatal mortality (aOR 2.34; 95% CI 1.20-4.56) but not with a lower Apgar score at 5 minutes, higher risk of cesarean section, preeclampsia or preterm birth. Vaccination slightly decreased the impact of SARS-CoV-2 infection during pregnancy on perinatal mortality. A positive SARS-CoV-2 test during pregnancy was associated with higher rates of stillbirth and perinatal mortality in Estonia but was not associated with change in preeclampsia, cesarean section or preterm birth rates.