The bidirectional communication between the central and the enteric nervous system named the gut-brain axis has been widely recognized. The gut microbiota has been implicated in a variety of stress-related conditions including anxiety, depression and irritable bowel syndrome based on rodent studies or correlative analysis in human patients. The aim of the present study was to investigate to what extent changes in behavior during stressful events and in the microbial composition of the colonic ecosystem were associated in horses. The microbiota alterations were induced by a change from a high-fiber diet (100% hay, H diet) to a progressive low-fiber and high-starch diet (56% hay and 44% barley, HB diet) on six fistulated horses. Colonic total anaerobic, cellulolytic, amylolytic and lactate-utilizing bacteria were enumerated once on H diet and once on HB diet. Bacterial richness, diversity and structure at family and genus level were also determined. The behavior of horses was assessed through two standardized stressful tests: a novelty test and an umbrella test. The different alterations measured in the colonic microbiota demonstrated a lower fibrolytic capacity and a higher amylolytic capacity of the ecosystem when horses received HB compared to H diet. During the novelty test, the frequency of blowing was significantly higher in HB than in H diet and was positively correlated with the concentration of amylolytic bacteria and the Succinivibrionaceae relative abundance. During the umbrella test, behavioral variables were not significantly different between the diets but the colonic content pH was negatively correlated with the frequency of startle response. Behavioral responses of anxiety were related to hindgut microbiota indicators of a high-starch diet. Dietary-induced modulation of the gut microbiota composition may have changed the horses' behavioral reactions in stressful situations.