We assessed the efficacy of perioperative antibiotic prophylaxis for surgery in a randomized, double-blind trial of 1218 patients undergoing herniorrhaphy or surgery involving the breast, including excision of a breast mass, mastectomy, reduction mammoplasty, and axillary-node dissection. The prophylactic regimen was a single dose of cefonicid (1 g intravenously) administered approximately half an hour before surgery. The patients were followed up for four to six weeks after surgery. Blinding was maintained until the last patient completed the follow-up and all diagnoses of infection had been made. The patients who received prophylaxis had 48 percent fewer probable or definite infections than those who did not (Mantel-Haenszel risk ratio, 0.52; 95 percent confidence interval, 0.32 to 0.84; P = 0.01). For patients undergoing a procedure involving the breast, infection occurred in 6.6 percent of the cefonicid recipients (20 of 303) and 12.2 percent of the placebo recipients (37 of 303); for those undergoing herniorrhaphy, infection occurred in 2.3 percent of the cefonicid recipients (7 of 301) and 4.2 percent of the placebo recipients (13 of 311). There were comparable reductions in the numbers of definite wound infections (Mantel-Haenszel risk ratio, 0.49), wounds that drained pus (risk ratio, 0.43), Staphylococcus aureus wound isolates (risk ratio, 0.49), and urinary tract infections (risk ratio, 0.40). There were also comparable reductions in the need for postoperative antibiotic therapy, non-routine visits to a physician for problems involving wound healing, incision and drainage procedures, and readmission because of problems with wound healing. We conclude that perioperative antibiotic prophylaxis with cefonicid is useful for herniorrhaphy and certain types of breast surgery.