Abstract Background Hepatitis B virus (HBV) infection has been associated with an increased risk of a few malignancies. However, the prognostic impact of HBV infection remains unclear in cervical cancer. Objective To explore the association between HBV infection and survival outcomes of patients with primary cervical cancer, using overall survival (OS) and disease‐free survival (DFS) as primary endpoints. Methods This analysis was performed retrospectively with newly diagnosed cervical cancer patients admitted to the Department of Gynecologic Oncology at the Sun Yat‐sen Memorial Hospital of Sun Yat‐sen University from June 2013 to October 2019, who were enrolled and followed up. The Kaplan–Meier method and Cox proportional hazard analysis were used to examine the performance of HBV infection in predicting OS and DFS. Results Patients were followed up for a median of 37.17 months (95% CI, 34.69–39.65). Among the 695 patients, 87 (12.5%) were serologically positive for hepatitis B surface antigen (HBsAg), and 276 (39.7%) had a prior history of HBV infection. There was no significant difference between HBsAg‐positive group and HBsAg‐negative patients concerning OS or DFS. Multivariate analysis showed prior HBV infection was an independent favorable prognosticator for OS (HR, 0.335; 95% CI, 0.153–0.0.734; p = 0.006) and DFS (HR, 0.398; 95% CI, 0.208–0.691; p = 0.002). Conclusion We provide the first clinical evidence that suggests prior HBV infection as an independent favorable prognostic factor for patients with primary cervical cancer.