Sub-Saharan Africa has the highest prevalence of human immunodeficiency virus (HIV)/acquired immune-deficiency syndrome (AIDS) and a high incidence of tuberculosis (TB). To determine the aetiology of and mortality due to community-acquired pneumonia (CAP) in HIV and non-HIV-infected adults. Consecutive patients with CAP admitted to a teaching hospital in KwaZulu-Natal over a 17-month period were studied prospectively. Systematic investigation of samples of sputum and blood cultures was performed. A subset of patients had urine antigen tests and serum serology. A total of 430 patients with a mean age of 33 years (range 18-82) were enrolled. Of the 382 patients tested, 311 (81.4%) were HIV-infected. Pathogens were isolated in 222 patients (52%). The most common organisms were Mycobacterium tuberculosis (39.6%) and Streptococcus pneumoniae (34.5%). M. tuberculosis was the most common agent in both HIV and non-HIV-infected subjects (40% and 35%, respectively). In-hospital mortality was 17% overall, 15.9% in the HIV-infected, 25% in the non-HIV-infected and 38% in patients with polymicrobial infections. M. tuberculosis was the leading cause of CAP and reflects the worsening TB epidemic in the region. Aggressive intervention is required to address both the HIV and TB epidemics in sub-Saharan Africa.