This article contributes methodologically and substantively to the debate over the importance of poverty, sexual behaviour and circumcision in relation to HIV infection, using panel data on young black men and women in Cape Town, South Africa. Methodological challenges included problems of endogeneity and blunt indicator variables, especially for the measurement of sexual behaviour. Noting these difficulties, we found that the importance of socioeconomic and sexual-behavioural factors differed between men and women. While we found a clear association between the number of years of sexual activity and HIV status among both men and women, we found that past participation in a concurrent sexual partnership increased the odds of HIV infection for men but not women. Women, but not men, who made the transition from school to tertiary education (our key indicator of socioeconomic status) were less likely to be HIV-positive than those who made the transition from school to unemployment. Both poverty and sexual behaviour matter to individuals’ HIV risk, but in gendered ways.