The aim of this study was to investigate the associations between sex hormone binding globulin (SHBG), visceral fat (VAT), liver fat content, and risk of type 2 diabetes. In the Netherlands Epidemiology of Obesity study 5690 women (53%) and men without pre-existing diabetes were included and followed for incident type 2 diabetes. SHBG concentrations were measured in all, VAT with MRI, and liver fat content with proton-MR spectroscopy in n=1822. We examined associations between SHBG and liver fat with linear regression and bidirectional Mendelian randomization analyses, and between SHBG and type 2 diabetes with Cox regression adjusted for confounding, and additionally for VAT and liver fat to examine mediation. The mean(SD) age was 56(6) years, BMI 30(4) kg/m2, median(IQR) SHBG was 47 (34,65) nmol/L in women and 34 (26,43) nmol/L in men, median(IQR) liver fat was 3.4(1.6,8.2)% in women and 6.0 (2.9,13.5)% in men. Compared with the highest SHBG quartile, liver fat was 2.9-fold (95%CI: 2.4,3.4) increased in women and 1.6-fold (95%CI: 1.3,1.8) in men, and the hazard ratio (95%CI) of type 2 diabetes was 4.9 (2.4,9.9) in women and 1.8 (1.1,2.9) in men. Genetically predicted SHBG was associated with liver fat content (women: SD (95%CI) -0.45(-0.55,-0.35), men: ln(95%CI) -0.25 (-0.34,-0.16)). VAT and liver fat together mediated 43% (women) and 60% (men) of the SHBG-type 2 diabetes association. To conclude, in a middle-aged population with overweight, the association between low SHBG and increased risk of type 2 diabetes was for a large part mediated by increased VAT and liver fat.