Pneumocystis carinii pneumonia (PCP) is the commonest opportunistic infection in AIDS patients. By using the polymerase chain reaction (PCR), specific DNA sequences can be amplified and used in diagnosis of infections such as PCP where the causative pathogen is both difficult to grow and present in low numbers. Twenty HIV positive patients were investigated for PCP. Twenty sputa (15 induced and 5 expectorated) had toluidine blue O staining, direct immunofluorescence and PCR performed for Pneumocystis carinii in a blinded fashion. PCR was performed using primers pAZ102-E 5' GATGGCTGTTTCCAAGCCCA 3' and pAZ102-H 5' GTGTACGTTGCAAAGTACTC 3' from the gene coding for Pneumocystis carinii mitochondrial ribosomal RNA with a specific 346 base-pair sequence being amplified from positive specimens. Ten of the patients had Pneumocystis carinii shown by conventional tests and PCR. Another 3 patients were positive only by PCR, all had evidence of infection with Pneumocystis carinii; the first was positive by subsequent conventional stains, the second was treated for bacterial bronchitis but had a non-resolving chest infection with PCP found on postmortem after 4 mths, the third had a typical interstitial infiltrate on CXR and responded to empiric PCP treatment. PCR is more sensitive than toluidine blue O staining and direct immunofluorescence in detecting Pneumocystis carinii in sputum from HIV patients and may become the diagnostic method of choice for PCP.