Objective. To identify predictors as free-text markers for mental ill-health from an electronic perinatal record (EMR) system and the association with emergency cesarean section (CS) in nulliparous women. Material and methods. This was a population-based study using an EMR system, set in the catchment area of Malmö University Hospital in Sweden. Of 10 662 nulliparous women presenting with a singleton cephalic baby for vaginal delivery between 2001 and 2006, 6 467 women with complete EMRs were selected. A free-text search of markers for mental ill-health was carried out, and results were analysed by multivariate logistic regression. Eleven markers for mental ill-health were tested with Cohen's kappa for agreement and used as exposure variables. Odds ratios (OR) with 95% confidence intervals (CI) were calculated for emergency CS, and adjusted for maternal age, diabetes, epidural anesthesia and gestational weeks <37 and >41 by a multivariate logistic regression model with vaginal delivery as the reference. Results. Three markers identified from the EMR system reached statistically significant associations with an increased risk for emergency CS in nulliparous women: stress, adjusted OR 1.66 (95% CI 1.34–2.06); sleep, adjusted OR 1.57 (95% CI 1.14–2.16); and worry, adjusted OR 1.41 (95% CI 1.10–1.79). Conclusion. Free-text words in medical records that indicated stress, sleep disturbances or worry predicted increased adjusted OR for emergency CS in first-time mothers. Recognizing pregnant women's reporting of their mental health status could have a predictive bearing on delivery outcomes.