Subclinical mastitis, defined as raised milk sodium/potassium (Na/K) ratio, is associated with poor infant growth and, among HIV-infected women, with increased milk HIV viral load. We conducted a longitudinal cohort study in Lusaka, Zambia, in order to investigate the relative importance of several potential causes of subclinical mastitis: maternal infection, micronutrient deficiencies and poor lactation practice. Women (198 HIV-infected, 189 HIV-uninfected) were recruited at 34 weeks' gestation and followed up to 16 weeks postpartum for collection of information on their health, their infant's health, infant growth and infant feeding practices. Milk samples were collected from each breast at 11 postpartum visits and blood at recruitment and 6 weeks postpartum. The geometric mean milk Na/K ratio and the proportion of women with Na/K ratio > 1.0 in one or both breasts were significantly higher among HIV-infected than among uninfected women. Other factors associated with the higher mean Na/K ratio in univariable analyses were primiparity, high maternal alpha(1)-acid glycoprotein (AGP) at 6 weeks, maternal overall morbidity and specific breast symptoms, preterm delivery, low infant weight or length, infant thrush and non-exclusive breast feeding. In multivariable analyses, primiparity, preterm delivery, breast symptoms, HIV status and raised AGP were associated with the raised Na/K ratio. Thus the main factors associated with subclinical mastitis that are amenable to intervention are poor maternal overall health and breast health. The impact of improved postpartum health care, especially management of maternal infections and especially in primiparous women, on the prevalence of subclinical mastitis and its consequences requires investigation.