Background: Human milk microorganisms contribute towards developing the gut microbiota in infants and in shaping the immune system in early life. We evaluated the effect of the maternal diet during pregnancy and during the first month of lactation on the human milk microbiota. Methods: A cross-sectional investigation included healthy lactating women with uncomplicated pregnancy. Associations between nutrients and human milk bacteria community were evaluated through PERMANOVA tests and clustering analysis using weighted UniFrac distance for nutrients. Findings: Three genera were present in all samples: Streptococcus, Staphylococcus, and Corynebacterium (mean relative abundance 42%, 22%, and 7%, respectively). Other genera, including Bifidobacterium and Lactobacillus, were detected at lower abundances. Significant differences in the microbiota composition were found only for vitamin C intake levels during pregnancy (p = 0.029). Clustering analysis revealed 2 clusters, one driven by Streptococcus (cluster 1), and one by Staphylococcus (cluster 2). During pregnancy, in cluster 2, intake of vitamin C was higher (median 232 mg/d; cluster 1 = 175 mg/d; p = 0.02) and trends towards higher levels of pectin (p = 0.053) and lycopene (p = 0.058) intake were observed. Also, a positive correlation between intake of polyunsaturated fatty acids/linoleic fatty acids during lactation and the proportion of Bifidobacterium in milk (rho coefficient = 0.29 and 0.27, respectively; p < 0.01) were observed. Interpretation: Maternal long-term dietary habits during pregnancy contribute towards shaping the human milk microbiota, which is only slightly influenced by maternal short-term diet (first month of lactation). Funding Statement: This work was supported by Sao Paulo State Research Funding Agency (FAPESP, Projects #2013/26435-3, 2013/07914-8, and 2016/07936-0).. Declaration of Interests: The authors declare that they have no competing interests. Ethics Approval Statement: The project was approved by the Research Ethics Committee of the School of Pharmaceutical Sciences, University of Sao Paulo, Sao Paulo, Brazil and by the Research Ethics Committee of the University Hospital of the University of Sao Paulo, Sao Paulo, Brazil - CAAE: 27247614.6.0000.0067. The selected women were invited to participate in the study and enrolled after signing the Written Informed Consent Form.