The gut microbiota in the hepatitis B virus related acute-on-chronic liver failure (HBV-ACLF) is poorly defined. We aim to uncover the characteristics of the gut microbiota in HBV-ACLF and in other HBV associated pathologies. We analyzed the gut microbiome in patients with HBV-ACLF or other HBV associated pathologies and healthy individuals by 16S rRNA sequencing and metagenomic sequencing of fecal samples. 212 patients with HBV-ACLF, 252 with chronic hepatitis B (CHB), 162 with HBV-associated cirrhosis (HBV-LC) and 877 healthy individuals were recruited for the study. CHB and HBV-LC patients are grouped as HBV-Other. We discovered striking differences in the microbiome diversity between the HBV-ACLF, HBV-Other and healthy groups using 16S rRNA sequencing. The ratio of cocci to bacilli was significantly elevated in the HBV-ACLF group compared with healthy group. Further analysis within the HBV-ACLF group identified 52 genera showing distinct richness within the group where Enterococcus was enriched in the progression group whilst Faecalibacterium was enriched in the regression group. Metagenomic sequencing validated these findings and further uncovered an enrichment of Lactobacillus casei paracasei in progression group, while Alistipes senegalensis, Faecalibacterium prausnitzii and Parabacteroides merdae dominated the regression group. Importantly, our analysis revealed that there was a rapid increase of Enterococcus faecium during the progression of HBV-ACLF. The gut microbiota displayed distinct composition at different phases of HBV-ACLF. High abundance of Enterococcus is associated with progression while that of Faecalibacterium is associated with regression of HBV-ACLF. Therefore, the microbiota features hold promising potential as prognostic markers for HBV-ACLF.