Inconsistent results have been reported regarding the association between low-to-moderate arsenic (As) exposure and diabetes. The effect of liver dysfunction on As-induced diabetes remains unclear. The cross-sectional study included 10,574 adults from 2017−2018 China National Human Biomonitoring. Urinary total As (TAs) levels were analyzed as markers of As exposure. Generalized linear mixed models and restricted cubic splines models were used to examine the relationships among TAs levels, serum alanine aminotransferase (ALT) and aspartate aminotransferase (AST) concentrations, and diabetes prevalence. Mediating analysis was performed to assess whether liver dysfunction mediated the association between TAs and diabetes. Overall, the OR (95% CI) of diabetes in participants in the second, third, and fourth quartiles of TAs were 1.08 (0.88, 1.33), 1.17 (0.94, 1.45), and 1.52 (1.22, 1.90), respectively, in the fully adjusted models compared with those in the lowest quartile. Serum ALT was positively associated with TAs and diabetes. Additionally, mediation analyses showed that ALT mediated 4.32% of the association between TAs and diabetes in the overall population and 8.86% in the population without alcohol consumption in the past year. This study suggested that alleviating the hepatotoxicity of As could have implications for both diabetes and liver disease.