The concentration of human immunodeficiency virus type 1 (HIV-1) is generally lower in breast milk than in blood. Mastitis, or inflammation of the breast, is associated with increased levels of milk HIV-1 and risk of mother-to-child transmission through breastfeeding. We hypothesized that mastitis facilitates the passage of HIV-1 from blood into milk or stimulates virus production within the breast. HIV-1 env sequences were generated from single amplicons obtained from breast milk and blood samples in a cross-sectional study. Viral compartmentalization was evaluated using several statistical methods, including the Slatkin and Maddison (SM) test. Mastitis was defined as an elevated milk sodium (Na(+)) concentration. The association between milk Na(+) and the pairwise genetic distance between milk and blood viral sequences was modeled using linear regression. HIV-1 was compartmentalized within milk by SM testing in 6/17 (35%) specimens obtained from 9 women, but all phylogenetic clades included viral sequences from milk and blood samples. Monotypic sequences were more prevalent in milk samples than in blood samples (22% versus 13%; P = 0.012), which accounted for half of the compartmentalization observed. Mastitis was not associated with compartmentalization by SM testing (P = 0.621), but Na(+) was correlated with greater genetic distance between milk and blood HIV-1 populations (P = 0.041). In conclusion, local production of HIV-1 within the breast is suggested by compartmentalization of virus and a higher prevalence of monotypic viruses in milk specimens. However, phylogenetic trees demonstrate extensive mixing of viruses between milk and blood specimens. HIV-1 replication in breast milk appears to increase with inflammation, contributing to higher milk viral loads during mastitis.