OBJECTIVE: To determine risk factors for the development of pneumothorax in patients with the acquired immunodeficiency syndrome (AIDS). DESIGN: Prospective cohort study. SETTING: Tertiary care center. PATIENTS: Of 1030 patients with AIDS who were followed at Memorial Sloan-Kettering Cancer Center between 1 January 1980 and 30 September 1989, 20 (2%) developed pneumothorax that was unrelated to trauma or a pulmonary procedure. RESULTS: Of 20 patients with AIDS who presented with pneumothorax, 19 had compelling evidence of concurrent Pneumocystis carinii pneumonia. Using bivariate analysis, patients receiving aerosol pentamidine prophylaxis (relative risk, 17.6) and those with a history of P. carinii pneumonia (relative risk, 14.5) were more likely to develop pneumothorax. By Mantel-Haenszel stratified analysis, aerosol pentamidine use was a statistically significant risk factor independent of a history of P. carinii pneumonia. The pneumothorax-related mortality rate was 10% and there was considerable morbidity. CONCLUSIONS: Patients with AIDS at the highest risk for developing pneumothorax are those with a history of P. carinii pneumonia who are receiving aerosol pentamidine prophylaxis but who nevertheless develop P. carinii pneumonia. The benefits of aerosol pentamidine prophylaxis in these patients far outweigh this risk. Pneumocystis carinii pneumonia should be considered as the most likely diagnosis in any patient with AIDS who develops a pneumothorax.