Perinatal maternal anxiety and depression negatively affect intrauterine fetal development, birth outcome, breastfeeding initiation, duration, and milk composition. Antenatal classes potentially reduce the anxiety of pregnant women and may thus contribute to healthy infant development. The study investigates the relationship between participation in online or in-person antenatal classes and levels of anxiety and depression in Polish women during the COVID-19 pandemic. The study group included 1774 adult, non-smoking pregnant women. We compared the state anxiety (STAI-State) and depression levels (EPDS) in women who (i) attended antenatal classes in-person, (ii) attended online classes, and (iii) did not attend any of them. The statistical analyses included a GLM model and trend analysis, while controlling for maternal trait anxiety, age, pregnancy complications, trimester of pregnancy, previous pregnancies, and COVID-19 infections. We observed statistically significant differences in the level of anxiety (and depression). Women who did attend antenatal classes in person had the lowest levels of anxiety and depression. Considering the importance of maternal mental well-being on fetal development, birth outcome, and breastfeeding, in-person participation in antenatal classes should be recommended to pregnant women.