Consecutive adult patients requiring emergency abdominal surgery were randomly allocated to preoperative treatment with metronidazole-gentamicin (M-G) or metronidazole-fosfomycin (M-F). Postoperative continuation of antibiotics depended on the estimated risk of septic complications. Peroperatively the cases were stratified as group A, acute inflamed appendicitis, or absence of septic disorder--no postoperative antibiotics, group B, gangrenous appendicitis or cholecystitis or intestinal obstruction without resection, or operations with contamination regarded as minor (gastrotomy or enterotomy)--three further doses of antibiotics, or group C, perforated appendicitis, perforation of the alimentary tract, generalized peritonitis or gross contamination--antibiotics continued for 5 days. Assessment for septic complications was made in 381 patients (191 M-G, 190 M-F). The total incidence was 4.8% (M-G 7.8%, M-F 1.6%, p less than 0.01). The difference was mainly due to higher infection rate in patients stratified to group C and randomized to M-G. Stratification thus permitted restricted duration of antibiotic treatment with a low septic complication rate, significantly less with M-F than with M-G regimen.