Commensal gut bacteria impact the host immune system and can influence disease processes in several organs, including the brain. However, it remains unclear whether the microbiota has an impact on the outcome of acute brain injury. Here we show that antibiotic-induced alterations in the intestinal flora reduces ischemic brain injury in mice, an effect transmissible by fecal transplants. Intestinal dysbiosis alters immune homeostasis in the small intestine leading to an increase in regulatory T cells and a reduction in IL-17 + γδ T cells, through altered dendritic cell activity. Dysbiosis suppresses trafficking of effector T cells from the gut to the leptomeninges after stroke. Interleukin-10 (IL-10) and IL-17 are required for the neuroprotection afforded by intestinal dysbiosis. The findings reveal a previously unrecognized gut-brain axis and the impact of the intestinal flora and meningeal IL-17 + γδ T cells on ischemic injury.