Objective: The intrauterine environment is known to affect the offspring’s long-term risk for obesity and diabetes. Previous data show that maternal metabolism and gestational weight gain (GWG) are associated with fetal autonomic nervous system (ANS) function, which can be assessed with heart rate variability (HRV). We investigated whether this association is also present in 2-year-old children and addressed the impact of gestational diabetes (GDM). Research design and methods: We examined the 2-year-old offspring of mothers who had undergone a 5-point, 75 g oral glucose tolerance test during pregnancy. To assess HRV, a 10-minute ECG was recorded, and time domain and frequency domain parameters were analyzed. Body composition was assessed using bioelectrical impedance testing. Results: We examined 67 children (33 girls, 34 boys), 30 of whom were born to mothers with treated GDM and normoglycemic pregnancies (NGT), respectively. No differences were found between the groups with regard to birth weight, weight at the age of 2 years, and body fat content. We observed that GWG was associated with heart rate and HRV, indicating that children of mothers with low GWG had a lower parasympathetic tone. This association was detected in NGT-exposed—but not in GDM-exposed—children. HR and HRV correlated with body fat and fat-free mass in children from normoglycemic pregnancies only. Conclusion: We found that the impact of maternal GWG on offspring ANS function was missing in the presence of treated GDM. The balance of the ANS was related to offspring body composition in children from NGT pregnancies only. Our results suggest that maternal weight gain during pregnancy has a critical impact on the developing ANS, which might be disturbed in the presence of GDM.