Although the specific pathogenesis of preterm birth (PTB) has not been thoroughly clarified, it is known to be related to various factors, such as pregnancy complications, maternal socioeconomic factors, lifestyle habits, reproductive history, environmental and psychological factors, prenatal care, and nutritional status. PTB has serious implications for newborns and families and is associated with high mortality and complications. Therefore, the prediction of PTB risk can facilitate early intervention and reduce its resultant adverse consequences. To analyze the risk factors for PTB to establish a PTB risk prediction model and to assess postpartum anxiety and depression in mothers. A retrospective analysis of 648 consecutive parturients who delivered at Shenzhen Bao'an District Songgang People's Hospital between January 2019 and January 2022 was performed. According to the diagnostic criteria for premature infants, the parturients were divided into a PTB group (n = 60) and a full-term (FT) group (n = 588). Puerperae were assessed by the Self-rating Anxiety Scale (SAS) and Self-rating Depression Scale (SDS), based on which the mothers with anxiety and depression symptoms were screened for further analysis. The factors affecting PTB were analyzed by univariate analysis, and the related risk factors were identified by logistic regression. According to univariate analysis, the PTB group was older than the FT group, with a smaller weight change and greater proportions of women who underwent artificial insemination and had gestational diabetes mellitus (P < 0.05). In addition, greater proportions of women with reproductive tract infections and greater white blood cell (WBC) counts (P < 0.05), shorter cervical lengths in the second trimester and lower neutrophil percentages (P < 0.001) were detected in the PTB group than in the FT group. The PTB group exhibited higher postpartum SAS and SDS scores than did the FT group (P < 0.0001), with a higher number of mothers experiencing anxiety and depression (P < 0.001). Multivariate logistic regression analysis revealed that a greater maternal weight change, the presence of gestational diabetes mellitus, a shorter cervical length in the second trimester, a greater WBC count, and the presence of maternal anxiety and depression were risk factors for PTB (P < 0.01). Moreover, the risk score of the FT group was lower than that of the PTB group, and the area under the curve of the risk score for predicting PTB was greater than 0.9. This study highlights the complex interplay between postpartum anxiety and PTB, where maternal anxiety may be a potential risk factor for PTB, with PTB potentially increasing the incidence of postpartum anxiety in mothers. In addition, a greater maternal weight change, the presence of gestational diabetes mellitus, a shorter cervical length, a greater WBC count, and postpartum anxiety and depression were identified as risk factors for PTB.