The aim of this study was to investigate the association of risk variants for type 2 diabetes (T2D) and hyperglycemia with gestational diabetes (GDM). Five hundred and thirty-three Finnish women who were diagnosed with GDM and 407 controls with normal glucose tolerance during the pregnancy were genotyped for 69 single-nucleotide polymorphisms (SNPs) which have been previously verified as susceptibility risk variants for T2D and hyperglycemia. All participants underwent an oral glucose tolerance test at the follow-up study after the index pregnancy. Risk variants rs10830963 and rs1387153 of MTNR1B were significantly associated with GDM (odds ratio (OR)=1.62 (95% CI 1.34-1.96), P=4.5 × 10⁻⁷ and 1.38 (1.14-1.66), P=7.6 × 10⁻⁴ respectively). Both SNPs of MTNR1B were also significantly associated with elevated fasting glucose level and reduced insulin secretion at follow-up. Additionally, risk variants rs9939609 of FTO, rs2796441 of TLE1, rs560887 of G6PC2, rs780094 of GCKR, rs7903146 of TCF7L2 and rs11708067 of ADCY5 showed nominally significant associations with GDM (OR range from 1.25 to 1.30). Our study suggests that GDM and T2D share a similar genetic background. Our findings also provide further evidence that risk variants of MTNR1B are associated with GDM by increasing fasting plasma glucose and decreasing insulin secretion.