OBJECTIVE: To examine the effect of an exercise and dietary intervention during pregnancy on excessive gestational weight gain (EGWG), dietary habit and physical activity in pregnant women. DESIGN: Randomised controlled trial. SETTING: Community-based study. POPULATION: Nondiabetic urban-living pregnant women (<26 weeks of gestation). METHODS: Participants in the intervention group were provided with community-based group exercise sessions, instructed home exercise and dietary counselling between 20 and 36 weeks of gestation. Participants in both groups received physical activity and food intake surveys at enrolment and 2 months after the enrolment. MAIN OUTCOME MEASURES: Prevalence of EGWG and measures of physical activity and food intakes between the two groups. RESULTS: A total of 190 pregnant women, 88 in the control group and 102 in the intervention group, completed the study. Decreased daily intakes of calorie, fat, saturated fat and cholesterol were detected in participants in the intervention group at 2 months after enrolment compared with the control group (P<0.01). Participants in the intervention group had higher physical activity 2 months after enrolment compared with the control group (P<0.01). The lifestyle intervention during pregnancy reduced the prevalence of EGWG in the intervention group compared with the control group (P<0.01) according to the guidelines of the Institute of Medicine. CONCLUSION: The findings suggest that lifestyle intervention during pregnancy increased physical activity, improved dietary habits and reduced EGWG in urban-living pregnant women.