Single-cell analysis reveals HBV-specific PD-1+CD8+ TRM cells in tumor borders are associated with HBV-related hepatic damage and fibrosis in HCC patients. This evidence concerns the gene CD8A and hepatocellular carcinoma.