Early life is a period of significant brain development when the brain is at its most plastic and vulnerable. Stressful episodes during this window of development have long-lasting effects on the central nervous system. Rodent maternal separation (MS) is a reliable model of early-life stress and induces alterations in both physiology and behaviour. Intriguingly, the gut microbiota of MS offspring differ from that of non-separated offspring, suggesting a mechanistic role for the microbiota-gut-brain axis. Hence, we tested whether dietary factors known to affect the gut microbiota alter the neurobehavioural effects of MS. The impact of consuming diet containing prebiotics polydextrose (PDX) and galactooligosaccharide (GOS) alone or in combination with live bacteria Lactobacillus rhamnosus GG (LGG) from weaning onwards in rats subjected to early-life MS was assessed. Adult offspring were assessed for anxiety-like behaviour in the open field test, spatial memory using the Morris water maze, and reactivity to restraint stress. Brains were examined via PCR for changes in mRNA gene expression. Here, we demonstrate that diets containing a combination of PDX/GOS and LGG attenuates the effects of early-life MS on anxiety-like behaviour and hippocampal-dependent learning with changes to hippocampal mRNA expression of genes related to stress circuitry, anxiety and learning.