In a prospective study, the etiology of community-acquired pneumonia (CAP) was investigated among consecutive patients admitted to an academic, urban public hospital in Seattle. The study population was uniquely young, was predominantly male, and had high rates of homelessness, cigarette smoking, alcoholism, injection drug use, and human immunodeficiency virus (HIV) infection. Leading causes of CAP among HIV-negative patients were aspiration, followed by Streptococcus pneumoniae, Legionella species, and Mycoplasma pneumoniae. Among HIV-positive patients, Pneumocystis carinii, Mycobacterium tuberculosis, S. pneumoniae, and M. pneumoniae were the most common etiologic agents. Severe CAP was associated with typical bacterial infections and aspiration pneumonia but not Legionella infection among HIV-negative patients and with Pseudomonas aeruginosa infections among HIV-positive patients. These findings emphasize the need to tailor empirical antibiotic therapy according to local patient populations and individual risk factors and highlight the importance of recognizing underlying HIV infection in patients who are hospitalized with CAP.