To delineate the natural clinical course of spontaneous bacterial peritonitis in hepatitis B-related cirrhosis and to determine if it occurs in hepatocellular carcinoma, a prospective survey was conducted in 262 patients over 2 1/2 years. The in-hospital incidence and mortality rates of spontaneous bacterial peritonitis were 21.6% and 36.4%, respectively, in cirrhosis and 7.3% and 50% in hepatocellular carcinoma. In cirrhosis, the cumulative probability of annual recurrence of spontaneous bacterial peritonitis was 47.3%, which was significantly higher than the annual probability of occurrence of 11.3% in those with no previous attack (P less than 0.0001). The cumulative probability of annual survival was 27.6% in the spontaneous bacterial peritonitis patients, significantly lower than the probability of 64.0% in the control group (P = 0.0001). A univariate analysis, with Kaplan-Meier curves compared by the Mantel-Cox test, and subsequent multivariate analysis by stepwise Cox regression procedure were used to evaluate 37 variables recorded immediately after admission. Blood urea nitrogen concentration greater than 10.5 mmol/L urea (greater than 30 mg/dL) and ascitic fluid protein concentration less than 7.35 g/L (less than 735 mg/dL) were found to be the only significant predictors of lower annual survival; ascitic fluid protein concentration less than 7.50 g/L (less than 750 mg/dL) was the only significant predictor of higher annual recurrence. The authors conclude that spontaneous bacterial peritonitis has a high risk of recurrence in hepatitis B-related cirrhosis and that the same disease occurring in patients with hepatocellular carcinoma is related to the underlying cirrhosis rather than the hepatocellular carcinoma.