Maternal nutrition during pregnancy plays a vital role in foetal growth and development. The present study aimed to describe the diet quality of pregnant women and explore the association between maternal diet and the prevalence of low birth weight (LBW) and small for gestational age (SGA). A total of 3 856 participants from a birth cohort in Beijing, China were recruited between June 2018 and February 2019. Maternal diet in the 1st and 2nd trimesters was assessed by inconsecutive 2-day 24-hour dietary recalls. The Chinese diet balance index for pregnancy (DBI-P) was used to assess the diet quality of the participants. Multivariate logistic regressions were performed to explore the independent effects of DBI-P components on LBW and SGA. The prevalence of LBW and SGA was 3.8% and 6.0%, respectively. Dietary intakes of the participants were imbalanced. The proportions of participants having insufficient intake of vegetables (87.3% and 86.6%), dairy (95.9% and 96.7%), and aquatic foods (80.5% and 85.3%) were high in both trimesters. The insufficiency of fruit intake was more severe in the 2nd trimester (85.2%) than in the 1st trimester (22.5%) (P<0.05). After adjusting for potential confounders, the intake of fruits and dairy in the 2nd trimester was negatively associated with the risk of LBW (OR=0.850, 95% CI: 0.723-0.999) and SGA (OR=0.885, 95% CI: 0.787-0.996), respectively. The diet of Beijing pregnant women was imbalanced. Higher consumption of fruits and dairy products in the 2nd trimester was associated with lower risks of LBW and SGA. Sufficient consumption of fruits and dairy products in pregnancy may be suggested, in an attempt to prevent the occurrence of LBW and SGA.