Maternal hyperglycemia is linked to adverse neonatal outcomes. However, current evidence was insufficient for mechanistic pathways. We aim to use two-sample Mendelian randomization (MR) to obtain a comprehensive understanding of the causal association and mediation pathways. Genetic variants of fasting glucose (FG), insulin sensitivity index (ISI), glycated haemoglobin (HbA1c), gestational diabetes mellitus (GDM) and type 2 diabetes (T2D) were used as instruments (N = 50 404-898 130). The associations with offspring birthweight, gestational duration, spontaneous preterm and post-term birth were assessed by the inverse-variance weighted method, using summary statistics of European genome-wide association studies (N = 131 279-210 248). Sensitivity analyses, including multivariable MR removing pleiotropic effect from maternal body mass index (BMI), assessed the robustness. Mediation via placental weight and maternal hypertension were assessed via a two-step MR design. FG (0.46 SD per mmol/L, 95% confidence interval [95% CI]: 0.32, 0.61) and GDM liability (0.18 SD per log odds, 95% CI: 0.08, 0.18) were positively associated with birthweight, with consistent findings for HbA1c, T2D liability and ISI. These associations were mediated by placental weight (proportion mediated: 32.8% to 77.7%). Higher HbA1c, GDM and T2D liability were associated with preterm birth (odds ratios for GDM: 1.07, 95% CI: 1.01, 1.14) and shorter gestational duration, whilst the association for T2D attenuated after adjusted for maternal BMI and gestational hypertension. Maternal hyperglycemia is associated with higher birthweight (possibly indicating macrosomia), mediated via increased placental growth. GDM and T2D liability are related to preterm birth, whilst the association for T2D liability is driven by maternal adiposity.