To assess the proportion of the association between obesity and diabetes mediated by liver enzymes such as gamma-glutamyltransferase (GGT), alanine transaminase (ALT), and aspartate transaminase (AST).Mediation analysis was used with adjustment for age, education, physical activity, smoking, and alcohol use.A total of 9748 participants from Phase III of the Guangzhou Biobank Cohort Study were recruited in 2006–2008. For women, the association of body mass index (BMI) and waist circumference (WC) with glucose was partially mediated by GGT, 30% (95% confidence interval 23%–40%) and 28% (23%–34%) and by ALT, 15% (14%–25%) and 14% (10%–18%), respectively; for men, the proportion mediated by GGT was 16% (9%–26%) and 23% (12%–36%), respectively, and by ALT 12% (4%–22%) for BMI and for WC. The association of BMI and WC with glucose was not mediated by AST for women or men. Additionally, considering of mediation by lipids did not change the mediation by GGT and ALT.The effect of obesity on diabetes is partly mediated by GGT and ALT but not AST. There is no evidence of the mediation effect by lipids. Our results may provide opportunities to identify new targets for diabetes interventions.