Hepatitis B virus surface and core antigens (HBsAg, HBcAg) were examined in the resected primary hepatocellular carcinoma from 204 patients who had HBsAg in serum. Ninety patients had small (<5 cm) and 114 had large hepatocellular carcinoma (>5 cm). HBsAg was detected in hepatocellular carcinoma in 65 cases (32%) and HBcAg in 30 cases (14.7%); hepatitis B virus antigens were more frequently detected in small (HBsAg in 42.2% and HBcAg in 20%) than in large hepatocellular carcinoma (HBsAg 23.7% and HBcAg 10.5%). These results suggest that replicative forms of hepatitis B virus DNA may exist in hepatocellular carcinoma more frequently than previously believed and that the malignant hepatocytes can support hepatitis B virus replication. A lymphocytic infiltration in hepatocellular carcinoma was more often observed in hepatocellular carcinoma expressing HBsAg (71%) or HBcAg (63%) than in hepatocellular carcinoma with no detectable HBsAg (26%) or HBcAg (37%), p < 0.01. The reaction was mild in the majority (85%) of the cases. These findings suggest that hepatitis B virus antigen expression in hepatocellular carcinoma can provoke a local immune response. The most striking finding was that patients with hepatitis B virus antigens in small hepatocellular carcinoma had a 5-year survival rate (13%) lower than that (50%) of the antigen-negative patients (p < 0.05). In contrast, patients with a marked local immune response in hepatocellular carcinoma, regardless of the viral antigen status, had significantly better 5-year survival rates (43%) than those with no or a mild lymphocytic reaction (18%). These findings indicate that a marked immune response in hepatocellular carcinoma is a favorable prognostic sign. The unfavorable course of the patient with viral antigen-expressing hepatocellular carcinoma may in fact reflect the inability of the host immune response to clear the viral infection and the antigen-expressing tumor cells.