Objective To identify patients who were most at risk of developing spontaneous bacterial peritonitis and who might benefit from selective intestinal decontamination. Design Prospective analysis of all patients admitted with liver cirrhosis during a 4-year period who had ascitic fluid analysis and appropriate bed-side inoculation of ascites in blood culture bottles. Setting Liver transplantation centre in a university hospital. Patients Thirty-one positive episodes and 92 negative episodes of spontaneous bacterial peritonitis were analysed and compared in 83 patients. Results The 1-year survival rate after spontaneous bacterial peritonitis was 14% compared with 43% in the group without spontaneous bacterial peritonitis. The calculated recurrence rate was 20%. The Child—Pugh classification and coagulation parameters were identified as predictive factors for the development of spontaneous bacterial peritonitis as was a deterioration in values for liver function tests. The total ascitic fluid protein content was not predictive. Sclerotherapy for oesophageal varices may also be a predictive factor, but this requires further investigation. Conclusions On the basis of our results, we recommend the use of selective intestinal decontamination for patients with liver cirrhosis Child—Pugh class C and ascites who develop rapidly progressive deterioration of liver function tests, patients who survived a first episode of spontaneous bacterial peritonitis and those awaiting liver transplantation.