There is little data on human milk oligosaccharide (HMO) composition in Sub-Saharan Africa. Iron fortificants adversely affect the infant gut microbiota, while co-provision of prebiotic galacto-oligosaccharides (GOS) mitigates most of the adverse effects. Whether variations in maternal HMO profile can influence the infant response to iron and/or GOS fortificants is unknown. The aim of this study was to determine HMO profiles and the secretor/non-secretor phenotype of lactating Kenyan mothers and investigate their effects on the maternal and infant gut microbiota, and on the infant response to a fortification intervention with 5 mg iron (2.5 mg as sodium iron ethylenediaminetetraacetate and 2.5 mg as ferrous fumarate) and 7.5 g GOS. We studied mother-infant pairs (n = 80) participating in a 4-month intervention trial in which the infants (aged 6.5-9.5 months) received daily a micronutrient powder without iron, with iron or with iron and GOS. We assessed: (1) maternal secretor status and HMO composition; (2) effects of secretor status on the maternal and infant gut microbiota in a cross-sectional analysis at baseline of the intervention trial; and (3) interactions between secretor status and intervention groups during the intervention trial on the infant gut microbiota, gut inflammation, iron status, growth and infectious morbidity. Secretor prevalence was 72% and HMOs differed between secretors and non-secretors and over time of lactation. Secretor status did not predict the baseline composition of the maternal and infant gut microbiota. There was a secretor-status-by-intervention-group interaction on Bifidobacterium (p = 0.021), Z-scores for length-for-age (p = 0.022) and weight-for-age (p = 0.018), and soluble transferrin receptor (p = 0.041). In the no iron group, longitudinal prevalence of diarrhea was higher among infants of non-secretors (23.8%) than of secretors (10.4%) (p = 0.001). In conclusion, HMO profile may modulate the infant gut microbiota response to fortificant iron; compared to infants of secretor mothers, infants of non-secretor mothers may be more vulnerable to the adverse effect of iron but also benefit more from the co-provision of GOS.