To evaluate trends in the length of survival for patients with acquired immunodeficiency syndrome, we calculated survival following diagnosis of acquired immunodeficiency syndrome for 4323 cases reported in San Francisco, Calif, between July 1981 and December 31, 1987. Patients were followed up prospectively through December 31, 1988. The median survival for all patients was 12.5 months, with a 5-year survival rate of 3.4%. Significantly improved survival was observed for patients diagnosed with Pneumocystis carinii pneumonia in 1986 and 1987. Survival for patients diagnosed with Kaposi's sarcoma declined significantly between 1981 and 1987. Survival was unchanged among patients diagnosed with other opportunistic infections or malignancies. Proportional hazards analyses indicated that initial diagnosis, age, and year of diagnosis were significant predictors of survival. For a subset of patients (n = 644), therapy with zidovudine was an additional significant predictor of survival. This study suggests that survival following diagnosis of acquired immunodeficiency syndrome has improved in recent years, primarily among patients with carinii pneumonia. Therapy with zidovudine may be partially responsible for these recent improvements.