ObjectiveTo assess the prevalence of anxiety and depression and their associated risk factors throughout the pregnancy and postpartum process using a new screening for the early detection of mental health problems.DesignA prospective cross-sectional descriptive multicentred study. Participants were consecutively enrolled at ≥ 12 weeks’ gestation and followed at three different time points: at 12–14 weeks of pregnancy, at 29–30 weeks of pregnancy, and 4–6 weeks postpartum. All women completed a mental screening at week 12–14 of pregnancy consisting of two questions from the Generalised Anxiety Disorder Scale (GAD-2) and the two Whooley questions. If this screening was positive, the woman completed the Edinburgh Postnatal Depression Scale (EPDS).SettingSeven primary care centres coordinated by a Gynaecology and Obstetrics Department in the city of Terrassa (Barcelona) in northern Spain.ParticipantsPregnant women (N = 335, age 18–45 years), in their first trimester of pregnancy, and receiving prenatal care in the public health system between July 2018 and July 2020.FindingsThe most relevant factors associated with positive screening for antenatal depression or anxiety during pregnancy, that appear after the first trimester of pregnancy, are systematically repeated throughout the pregnancy, and are maintained in the postpartum period were: a history of previous depression, previous anxiety, abuse, and marital problems. In weeks 12–14 early risk factors for positive depression and anxiety screening and positive EPDS were: age, smoking, educational level, employment status, previous psychological/psychiatric history and treatment, suicide in the family environment, voluntary termination of pregnancy and current planned pregnancy, living with a partner and partner’s income. In weeks 29–30 risk factors were: being a skilled worker, a history of previous depression or anxiety, and marital problems. In weeks 4–6 postpartum, risk factors were: age, a history of previous depression or anxiety or psychological/psychiatric treatment, type of treatment, having been mistreated, and marital problems.ConclusionsEarly screening for anxiety and depression in pregnancy may enable the creation of more effective healthcare pathways, by acting long before mental health problems in pregnant women worsen or by preventing their onset. Assessment of anxiety and depression symptoms before and after childbirth and emotional support needs to be incorporated into routine practice.