Background: Maternal diet is critical to the development of gestational diabetes mellitus (GDM), but sparse studies have applied the Chinese Dietary Balance Index for Pregnancy (DBI-P) to assess the maternal dietary quality and its relationship with GDM. We aimed to examine the maternal dietary quality and its relationship with GDM risk using the newly developed DBI-P. Methods: We included 1122 pregnant women from the Tongji Birth Cohort (TJBC) in Wuhan, China. The semi-quantitative food frequency questionnaire (FFQ) was used to obtain the dietary information during pregnancy. The newly developed DBI-P, including DBI-P components and DBI-P dietary patterns, was applied to comprehensively evaluate the maternal dietary quality. GDM was diagnosed by the 75-g, 2-h oral glucose tolerance test at 24-28 weeks gestation. We used a generalized linear regression model to examine the relationship between DBI-P components and blood glucose levels, and a logistic regression model to examine the relationship between dietary patterns and GDM. Results: A total of 179 participants (16.0%) were diagnosed with GDM. There is a widespread phenomenon of dietary imbalance among pregnant women in Wuhan. With per score increase in nuts and eggs, fasting blood glucose increase by 0.03 mmol/l (95% CI: 0.01, 0.05) and 0.01 mmol/l (95 %CI: 0.01, 0.03), respectively, while per score increase in fruits, 1-h post-load blood glucose decreased by 0.05 mmol/l (95% CI: -0.10, -0.01). Besides, compared with pattern E characterized by higher intake of total energy, total fat, fruits, and cooking oil, pattern B (OR: 0.51, 95% CI: 0.26, 0.99) and pattern C (OR: 0.27, 95% CI: 0.09, 0.81) were associated with a lower GDM risk. The associations between dietary patterns and GDM risk may be partly attributed to the intakes of dietary total fat, carbohydrate, cholesterol, eggs, and cooking oil. Conclusions: Unfavorable dietary quality during pregnancy is associated with a higher risk of GDM. The newly established DBI-P can provide an easy-to-implement tool to assess maternal dietary quality. These findings will provide new insights for the exploration of preferable dietary evaluation methods and prevention and control of GDM.