Prophylaxis with co-trimoxazole (trimethoprim-sulphamethoxazole) is recommended for people with HIV infection or AIDS but is rarely used in Africa. We assessed the effect of such prophylaxis on morbidity, mortality, CD4-cell count, and viral load among people with HIV infection living in rural Uganda, an area with high rates of bacterial resistance to co-trimoxazole. Between April, 2001, and March, 2003, we enrolled, and followed up with weekly home visits, 509 individuals with HIV-1 infection and their 1522 HIV-negative household members. After 5 months of follow-up, HIV-positive participants were offered daily co-trimoxazole prophylaxis (800 mg trimethoprim, 160 mg sulphamethoxazole) and followed up for a further 1.5 years. We assessed rates of malaria, diarrhoea, hospital admission, and death. Co-trimoxazole was well tolerated with rare (<2% per person-year) adverse reactions. Even though rates of resistance in diarrhoeal pathogens were high (76%), co-trimoxazole prophylaxis was associated with a 46% reduction in mortality (hazard ratio 0.54 [95% CI 0.35-0.84], p=0.006) and lower rates of malaria (multivariate incidence rate ratio 0.28 [0.19-0.40], p<0.0001), diarrhoea (0.65 [0.53-0.81], p<0.0001), and hospital admission (0.69 [0.48-0.98], p=0.04). The annual rate of decline in CD4-cell count was less during prophylaxis than before (77 vs 203 cells per microL, p<0.0001), and the annual rate of increase in viral load was lower (0.08 vs 0.90 log(10) copies per mL, p=0.01). Daily co-trimoxazole prophylaxis was associated with reduced morbidity and mortality and had beneficial effects on CD4-cell count and viral load. Co-trimoxazole prophylaxis is a readily available, effective intervention for people with HIV infection in Africa.