Exclusive breast-feeding (EBF) for 6 months supports optimal infant growth, health and development. This paper examined whether maternal HIV status was associated with EBF and other infant feeding practices. Pregnant women were enrolled after HIV counselling, and their babies were followed up for up to 1 year. Data on household socio-economics and demographics, maternal characteristics and infants’ daily diet were available for 482 infants and their mothers (150 HIV-positive (HIV-P), 170 HIV-negative (HIV-N) and 162 HIV-unknown (HIV-U)). Survival analyses estimated median EBF duration and time to introduction of liquids and foods; hazards ratios (HR) used data from 1–365 and 1–183 d, adjusting for covariates. Logistic regression estimated the probability of EBF for 6 months. Being HIV-P was associated with a shorter EBF duration (139 d) compared with HIV-N (163 d) and HIV-U (165 d) (P=0·004). Compared with HIV-N, being HIV-P was associated with about a 40 % higher risk of stopping EBF at any time point (HR 1·39; 95 % CI 1·06, 1·84; P=0·018) and less than half as likely to complete 6 months of EBF (adjusted OR 0·42; 95 % CI 0·22, 0·81; P=0·01). Being HIV-P tended to be or was associated with a higher risk of introducing non-milk liquids (HR 1·34; 95 % CI 0·98, 1·83; P=0·068), animal milks (HR 2·37; 95 % CI 1·32, 4·24; P=0·004) and solids (HR 1·56; 95 % CI 1·10, 2·22; P=0·011) during the first 6 months. Weight-for-age Z-score was associated with EBF and introducing formula. Different factors (ethnicity, food insecurity, HIV testing strategy) were associated with the various feeding behaviours, suggesting that diverse interventions are needed to promote optimal infant feeding.