Eighty-one bronchoalveolar lavage (BAL) specimens obtained from 26 HIV-infected, 45 non-HIV immunosuppressed and 10 immunocompetent patients with primary pulmonary diseases were analysed for the presence of Pneumocystis carinii by staining and by P. carinii 5S rDNA determined by PCR. P. carinii was observed by staining of BAL specimens from HIV-infected patients significantly more frequently than those from immunocompromised hosts without HIV infection (57.7% versus 20.0%, respectively). P. carinii 5S rDNA was detected by PCR assay in seven (26.9%) HIV-infected individuals, which was significantly more frequent than for four (8.9%) immunosuppressed patients without HIV infection, for whom staining was negative. None of these patients developed P. carinii pneumonia (PCP) within the follow-up period. BAL specimens from 10 immunocompetent patients with pulmonary disorders were negative for PCP by both staining and PCR assay.