Prediction models have shown promise in helping clinicians and patients engage in shared decision-making by providing quantitative estimates of individual risk of important clinical outcomes. Gestational diabetes mellitus is a common complication of pregnancy, which places patients at higher risk of primary CD. Suspected fetal macrosomia diagnosed on prenatal ultrasound is a well-known risk factor for primary CD in patients with gestational diabetes mellitus, but tools incorporating multiple risk factors to provide more accurate CD risk are lacking. Such tools could help facilitate shared decision-making and risk reduction by identifying patients with both high and low chances of intrapartum primary CD. This study aimed to develop and internally validate a multivariable model to estimate the risk of intrapartum primary CD in pregnancies complicated by gestational diabetes mellitus undergoing a trial of labor. This study identified a cohort of patients with gestational diabetes mellitus derived from a large, National Institutes of Health-funded medical record abstraction study who delivered singleton live-born infants at ≥34 weeks of gestation at a large tertiary care center between January 2002 and March 2013. The exclusion criteria included previous CD, contraindications to vaginal delivery, scheduled primary CD, and known fetal anomalies. Candidate predictors were clinical variables routinely available to a practitioner in the third trimester of pregnancy found to be associated with an increased risk of CD in gestational diabetes mellitus. Stepwise backward elimination was used to build the logistic regression model. The Hosmer-Lemeshow test was used to demonstrate goodness of fit. Model discrimination was evaluated via the concordance index and displayed as the area under the receiver operating characteristic curve. Internal model validation was performed with bootstrapping of the original dataset. Random resampling with replacement was performed for 1000 replications to assess predictive ability. An additional analysis was performed in which the population was stratified by parity to evaluate the model's predictive ability among nulliparous and multiparous individuals. Of the 3570 pregnancies meeting the study criteria, 987 (28%) had a primary CD. Of note, 8 variables were included in the final model, all significantly associated with CD. They included large for gestational age, polyhydramnios, older maternal age, early pregnancy body mass index, first hemoglobin A1C recorded in pregnancy, nulliparity, insulin treatment, and preeclampsia. Model calibration and discrimination were satisfactory with the Hosmer-Lemeshow test (P=.862) and an area under the receiver operating characteristic curve of 0.75 (95% confidence interval, 0.74-0.77). Internal validation demonstrated similar discriminatory ability. Stratification by parity demonstrated that the model worked well among both nulliparous and multiparous patients. Using information routinely available in the third trimester of pregnancy, a clinically pragmatic model can predict intrapartum primary CD risk with reasonable reliability in pregnancies complicated by gestational diabetes mellitus and may provide quantitative data to guide patients in understanding their individual primary CD risk based on preexisting and acquired risk factors.