The epidemiology of tuberculosis remains poorly understood. We investigated the relative importance of within-household and community transmission of infection among children aged 6 months to 14 years living in a Peruvian shanty-town. The prevalence of Mycobacterium tuberculosis exposure among 175 contact children (sharing a household with a person who had confirmed pulmonary tuberculosis) and 382 control children (living in nearby households free of active tuberculosis) was defined as the proportion of children with a positive purified protein derivative (PPD) skin-test. 97 (55%) contact children and 129 (34%) controls were PPD positive. Living in a contact household (odds ratio 1.74, 95% CI 1.11-2.73) and age (1.11, 1.06-1.18) were significant risk factors for PPD positivity. We calculated the community infection ratio (CIR) as the odds ratio of PPD-positive controls to PPD-positive contacts: CIR = [formula: see text] A low CIR therefore suggests mainly household spread of infection, whereas a high value suggests frequent transmission outside the household. The adjusted odds ratio (for age, sex, within-household correlation, and household size) was 0.40 (95% CI 0.26-0.64), compared with values of 0.18-0.37 in studies elsewhere. Currently recommended tuberculosis control strategies are suitable for areas with low CIRs. Different strategies may be needed for areas, such as that we studied, with high values.