Background: Although trimethoprim-sulfameth-oxazole is the drug of choice of the prevention of Pneumocystis carinii pneumonia, many patients cannot tolerate it and must switch to an alternative agent. Methods: We conducted a multicenter, open-label, randomized trial comparing daily atovaquone (1500 mg suspension) with daily dapsone (100 mg) for the prevention of P. carinii pneumonia among patients infected with the human immunodeficiency virus who could not tolerate trimethoprim-sulfamethoxazole. The median follow-up period was 27 months. Results: Of 1057 patients enrolled, 298 had a history of P. carinii pneumonia. P. carinii pneumonia developed in 122 of 536 patients assigned to atovaquone (15.7 cases per 100 person-years), as compared with 135 of 521 in the dapsone group (18.4 cases per 100 person-years; relative risk for atovaquone vs. dapsone, 0.85; 95 percent confidence interval, 0.67 to 1.09; P=0.20). The relative risk of death was 1.07 (95 percent confidence interval, 0.89 to 1.30; P=0.45), and the relative risk of discontinuation of the assigned medication because of adverse events was 0.94 (95 percent confidence interval, 0.74 to 1.19; P=0.59). Among the 546 patients who were receiving dapsone at base line, the relative risk of discontinuation because of adverse events was 3.78 for atovaquone as compared with dapsone (95 percent confidence interval, 2.37 to 6.01; P>0.001); among those not receiving dapsone at base line, it was 0.42 (95 percent confidence interval, 0.30 to 0.58; P<0.001). Conclusions: Among patients who cannot tolerate trimethoprim-sulfamethoxazole, atovaquone and dapsone are similarly effective for the prevention of P. carinii pneumonia. Our results support the continuation of dapsone prophylaxis among patients who are already receiving it. However, among those not receiving dapsone, atovaquone is better tolerated and may be the preferred choice for prophylaxis against P. carinii pneumonia.