Overuse of antibiotic drugs alters the composition of gut microbiota and has detrimental effects on the host. In our study, we investigated association of gut flora and antibiotics in the prognosis of patients with liver cancer who have undergone chemotherapy by analyzing two independent clinical studies. We retrospectively subanalyzed a previously reported randomized controlled trial (RCT) on hepatic arterial infusion chemotherapy in patients with hepatocellular carcinoma (HCC) to investigate the association between use of antibiotics and prognosis. In the other study, we prospectively determined the abundance of specific bacterial genus in patients with HCC by sequencing 16S ribosomal RNA and assessed its association with survival. Subanalysis of the RCT data showed that, of 26 types of antibiotics used, administration of carbapenem before or during chemotherapy was associated with poor progression-free survival (PFS) and overall survival (OS) of patients with HCC (carbapenem + vs. -; median PFS, 78 days vs. 154 days, p = 0.0053; median OS, 177 days vs. 475 days, p = 0.0003). Multivariate analysis revealed that antianaerobic drug use is an independent predictor of poor prognosis. In the prospective study, the abundance of Blautia in fecal microbiota correlated positively with both PFS and OS of patients with HCC who underwent chemotherapy. Use of antibiotics targeting anaerobes is associated with a poor prognosis in patients with HCC who have undergone chemotherapy, whereas the intestinal anaerobic bacteria, Blautia is associated with a good prognosis. These findings might indicate the need for caution regarding overuse of broad-spectrum antibiotics targeting anaerobes in patients with HCC. © 2019 The Authors. International Journal of Cancer published by John Wiley & Sons Ltd on behalf of UICC.