Heat stress and mastitis are major economic issues in dairy production. the objective was to test whether goat's mammary gland immune response to E. coli lipopolysaccharide (LpS) could be conditioned by heat stress (HS). changes in milk composition and milk metabolomics were evaluated after the administration of LpS in mammary glands of dairy goats under thermal-neutral (tn; n = 4; 15 to 20 °C; 40 to 45% humidity) or HS (n = 4; 35 °C day, 28 °C night; 40% humidity) conditions. Milk metabolomics were evaluated using 1 H nuclear magnetic resonance spectroscopy, and multivariate analyses were carried out. Heat stress reduced feed intake and milk yield by 28 and 21%, respectively. Mammary treatment with LpS resulted in febrile response that was detectable in tn goats, but was masked by elevated body temperature due to heat load in HS goats. Additionally, LpS increased milk protein and decreased milk lactose, with more marked changes in HS goats. the recruitment of somatic cells in milk after LpS treatment was delayed by HS. Milk metabolomics revealed that citrate increased by HS, whereas choline, phosphocholine, n-acetylcarbohydrates, lactate, and ß-hydroxybutyrate could be considered as putative markers of inflammation with different pattern according to the ambient temperature (i.e. tn vs. HS). in conclusion, changes in milk somatic cells and milk metabolomics indicated that heat stress affected the mammary immune response to simulated infection, which could make dairy animals more vulnerable to mastitis.The negative effects of heat stress (HS) on the productivity of dairy animals in terms of milk yield, milk composition and milk quality are well documented 1,2 . Despite advances in cooling systems and environmental management, HS constitutes to be a significant cost for the dairy industry 3 . Goats, originated from hot and arid zones, are considered less sensitive to HS compared to cows. However, milk production losses have been reported in heat-stressed dairy goats, especially at early stages of lactation 4,5 .The effect of HS on performance (e.g. milk yield, milk composition, feed intake, body temperature, respiratory rate) has been intensively evaluated in dairy animals 1,2 . However, only a few studies evaluated the omics of biofluids and tissues in animals exposed to HS such as cow's blood plasma 6 , cow's milk 7 , cow's liver 8 and goat's urine 9 .Besides the negative impact of HS on milk production, HS has been found to disrupt the immune function 5 . With regard to mammary immunity during HS, available data indicate that mammary immunity might be compromised by HS. Thompson et al. 10 reported that cows without cooling during the dry period have higher incidence of mastitis in the ensuing lactation. At the systemic level, Contreras-Jodar et al. 5 evaluated the transcriptomics of blood immune cells in heat-stressed goats and detected a decrease in the hematopoiesis and www.nature.com/scientificreports www.nature.com/scientificreports/ leukocyte diapedesis, which might compromise the innate and the adaptive ...