Fifty patients with P. carinii pneumonitis were randomized to receive either pentamidine isethionate or trimethoprim-sulfamethoxazole therapy. Those not responding favorably to the first drug after three or more days of therapy were changed to the alternate drug. Of the 26 patients initially treated with TMP-SMZ, 20 recovered (0.77)-17 after TMP-SMZ alone and three of nine who were crossed over to pentamidine. Of the 24 patients initially treated with pentamidine, 18 recovered (0.75)-14 of 15 who received only pentamidine and four of nine who were crossed over to TMP-SMZ. Abnormal values for blood urea nitrogen, creatinine, or glucose; inflammation at injection sites; or combination of these effects occurred in 14 of the 15 patients treated with pentamidine alone. Only one of the 17 patients treated with TMP-SMZ alone developed any of these abnormalities. This study shows that TMP-SMZ is as effective as pentamidine in the treatment of PCP, and that it offers the advantages of minimal adverse effects, oral administration, and ready availability.