The majority of children with HIV infection live in low-income countries without access to antiretroviral drugs. The prevention and early treatment of opportunistic infections are the mainstay of their medical management. Cotrimoxazole is cheap and effective against a wide range of organisms, including Pneumocystis jiroveci pneumonia (PCP), which is an important cause of death and illness in the first year of life. It is safe with relatively few side effects. Diagnosis of HIV in children is complicated by the presence of maternal antibodies in early life. Providing prophylaxis based initially on maternal status is one possible solution. However, routine prophylactic treatment is difficult to deliver in low-resource settings, and could also lead to increased resistance to the drug.