To investigate the possible association between different prophylactic sulfa drugs and the genotype of the Pneumocystis jiroveci dihydropteroate synthase (DHPS) gene, we examined DHPS polymorphisms in clinical specimens from 158 immunosuppressed patients (38 HIV-negative and 120 HIV-positive), using polymerase chain reaction-single-strand conformation polymorphism. Fifty-seven (36.1%) of 158 patients were infected with a mutant DHPS genotype. All patients who developed P. jiroveci pneumonia (PcP) while receiving pyrimethamine/sulfadoxine (PM/SD) prophylaxis (n=14) had a strain harboring DHPS with an amino acid change at position 57 (Pro-->Ser). This mutation was only present in 20 (14%) of 144 patients not receiving prophylaxis (P<.001). Hospitalization in a specific hospital was an independent risk factor for having P. jiroveci harboring the same DHPS mutation, which indirectly supports that interhuman transmission may affect the dissemination of the mutant strains.