Factors determining the outcome of an episode of Pneumocystis carinii pneumonia (PCP) in 149 AIDS patients treated at St Mary's Hospital were identified and their importance on improved survival evaluated between 1984 and 1989. The proportion of fatal episodes of PCP decreased over time. Fatal compared with nonfatal episodes had lower mean alveolar-arterial oxygen gradient (82.5 mmHg vs 53.8 mmHg, P less than 0.001), mean haemoglobin level (11.2 g/dl vs 12.1 g/dl, P = 0.01), mean lymphocyte count (0.68 x 10(9)/l vs 0.92 x 10(9)/l, P = 0.05) and more coinfections (31% vs 5%, P less than 0.001). Over time, the most significant change which occurred was a reduction in alveolar-arterial oxygen gradient at time of first presentation with PCP (r = -0.37, P less than 0.001). Mean alveolar-arterial oxygen gradient declined from 79.9 mmHg in 1984 to 45.3 mmHg in 1989 (r = -0.88, P = 0.02), independently of zidovudine therapy or PCP prophylaxis. Patients were being treated at an earlier stage in their disease course as indicated by their reduced alveolar arterial oxygen gradient. This is due either to earlier patient presentation, earlier medical diagnosis or both. The widespread introduction of zidovudine and PCP prophylaxis may further contribute to improve morbidity and mortality patterns in the future.