Hepatitis B virus (HBV) infection has been reported to be associated with gastric cancer (GC). Nonetheless, no study has revealed the role of HBV infection in the survival of patients with GC, and the mutation profiles of HBV-infected patients with GC have never been documented. Here, we performed an updated meta-analysis and found a significantly increased risk of GC in HBV-infected individuals (sOR, 1.29; 95% CI, 1.22-1.37). Furthermore, we observed that in the Anhui area, the rate of serum HBsAg positivity (OR, 1.62; 95% CI, 1.03-2.55) was significantly higher in GC patients than in controls. Moreover, our results showed that HBV-positive patients had significantly worse disease-free survival (HR, 1.98; 95% CI, 1.39-2.82) and overall survival (HR, 1.84; 95% CI, 1.19-2.85) than HBV-negative patients. The results of Cox proportional hazards regression proved that HBV infection was an independent adverse prognostic factor in GC. Furthermore, by performing targeted-NGS, we found unique mutation profiles in HBV-infected GC samples, including five frequently mutated protein-coding genes (KMT2B, KMT2D, SOX1, FGF12, and TUBB2B). Expression and survival analyses of these genes identified three novel candidate genes that may have potential roles in GC development. Gene Ontology enrichment analysis showed that the recurrent mutations in HBV-positive GC samples were related to cell proliferation, cell migration, and transcription. Taking together, our study proved that HBV infection is an independent prognostic factor in GC patients. The unique mutation profiles of HBV-infected patients with GC open a new research direction toward the underling mechanism between HBV infection and GC.