To identify risk factors for pneumococcal infection among human immunodeficiency virus-infected patients, a nested case-control study was done in an urban university human immunodeficiency virus clinic. Subjects with pneumococcal illness seen between 1 January 1990 and 1 July 1994 (n=85) were randomly matched to controls from the same population. Patients with pneumococcal disease were more likely than controls to be African Americans (adjusted odds ratio [OR]=3.92), have <200 CD4 cells/mm3 (adjusted OR=3.38), have a history of any pneumonia (adjusted OR=3.28), and have an albumin level of <3.0 g/dL (adjusted OR=6.25). Use of zidovudine (adjusted OR=0.38) and pneumococcal vaccination when the subject had >200 CD4 cells/mm3 (adjusted OR=0.22) were less common in cases than in controls. Similar results were found when only cases with infections of usually sterile sites were analyzed. Pneumococcal vaccine may be most protective when it is administered before advanced immunodeficiency develops.