Tuberculosis (TB) is associated with human immunodeficiency virus (HIV) infection, increasing age and male sex, but less is known about other risk factors in developing countries. As part of the Karonga Prevention Study in northern Malawi, we conducted a retrospective cohort study in the general population to assess risk factors for the development of TB. Individuals were identified in 1986-89 and TB cases diagnosed up to 1996 were included. TB was confirmed in 62/11,059 (0.56%) HIV negative individuals and 7/182 (3.9%) HIV positive individuals (relative risk 7.1, 95% confidence interval 3.2-15.7). This association was little altered by adjustment for age, sex or socioeconomic factors. The risk of TB was higher in those aged over 30 years than in younger individuals, in men than in women, in those engaged in occupations other than farming than in subsistence farmers, in those living in households with burnt brick dwellings than in those with less well built dwellings, and in those with some schooling than in those with none. These associations persisted after adjusting for age, sex, HIV status and population density. The absolute risks of TB were low in this study due to the passive follow-up and strict diagnostic criteria. The relative risk with HIV was of a similar magnitude to that measured elsewhere. Increased risks of TB with age and in men are expected. Associations with measures of higher socioeconomic status were unexpected. They may reflect a greater likelihood of diagnosis in this group