To evaluate the effect of antibiotic prophylaxis in pacemaker surgery, 100 patients were randomly assigned to a prophylaxis group receiving cloxacillin or to a control group with no antibiotics. Cloxacillin was given intravenously (2 g) 2 hours before operation, followed by 1 g every 6 hours for 2 days and the same dose perorally for 8 more days postoperatively. Adequate plasma concentrations were obtained in all patients. The follow-up time was 1-43 months. The infection rate was 2% (1/50) in the prophylaxis group and 14% (7/50) in the control group (p less than 0.05). The interval from operation to manifest infection was 9-35 days. In the control group the causal microorganism was Staphylococcus aureus in two patients, Staphylococcus epidermidis in two and unknown in three patients. In the only patient with infection in the prophylaxis group, a methicillin-resistant S. epidermidis was isolated. Infection was initially localized to the pacemaker pocket in seven patients, but septicemia developed in one of them and endocarditis in another. In one patient septicemia appeared initially, without local signs of infection. This study suggests that cloxacillin prophylaxis is of value in routine pacemaker surgery.