Detection of Pneumocystis carinii by the polymerase chain reaction (PCR) may facilitate non-invasive diagnosis of P carinii pneumonia and study of its epidemiology. We have compared the sensitivity and specificity of two PCR methods with those of conventional staining for detection of P carinii in induced sputum, bronchoalveolar lavage fluid (BAL), and blood. Of 71 sputum samples, 17 were from patients with microbiologically confirmed P carinii pneumonia. A nested PCR method correctly identified the presence of P carinii in all 17 (100% sensitive, 95% confidence interval [CI] 81-100%) and found no organisms in 50 of 54 microbiologically negative samples (93% specific, 95% CI 82-98%). PCR with a single primer pair was 71% sensitive (44-90%) and 94% specific (85-99%). The sensitivity of conventional staining methods (direct and indirect fluorescence antibody and toluidine-blue-O tests) was significantly less (38-53%) than that of nested PCR (p less than 0.05). In BAL, neither PCR method was significantly better than the conventional staining methods. P carinii was detected in BAL or sputum from 10 immunocompromised patients without microbiological evidence of P carinii pneumonia, which suggests that symptom-free carriers or subclinical infection can exist. P carinii was detected by nested PCR in blood from 2 of 3 patients with disseminated pneumocystosis but in only 1 of 11 patients with P carinii infection restricted to the lungs. Nested PCR on induced sputum is more sensitive than conventional staining methods for the diagnosis of P carinii pneumonia and provides a non-invasive method of detecting disseminated disease.