Objective · To investigate the relationship of hepatitis B virus (HBV) infection in different liver function status with gestational diabetes mellitus (GDM). Methods · Clinical data of 748 pregnant women with GDM were retrospectively analyzed. They were assigned to three groups according to HBV infection status and their liver function at second trimester, the A group (with abnormal liver function and chronic hepatitis B, n=124), the B group (with normal liver function and chronic HBV carriers or inactive HBsAg carriers, n=264), and the C group (without HBV infection, n=360). The glucose metabolism, pregnancy outcomes, and neonates were compared among three groups. Results · The A group had significantly higher blood glucose and HbA1c levels at all time points in OGTT than the B and C groups. The A group had markedly higher rates of HDCP, ICP, and cesarean delivery than the B and C groups. The A group had significantly lower body weight, Apgar score, and the rate of macrosomia than the B and C groups. Conclusion · Abnormal liver function in pregnant women with chronic hepatitis B at the second trimester can result in apparent abnormal glucose metabolism, increase the risk of pregnancy, childbirth, and neonatal complications, and deteriorate GDM. Enhancing the management of HBV-positive GDM pregnant women, regularly monitoring liver function and blood glucose, and maintaining normal liver function and blood glucose are helpful for reducing adverse pregnancy outcomes.