Increasing evidence indicates that alterations in gut microbiota are associated with mammalian development and physiology. The gut microbiota has been proposed as an essential player in metabolic diseases including brain health. This study aimed to determine the impact of probiotics on degenerative changes in the gut microbiota and cognitive behavior. Assessment of various behavioral and physiological functions was performed using Y-maze tests, wheel running tests, accelerated rotarod tests, balance beam tests, and forced swimming tests (FSTs), using adult mice after 50 weeks of administering living probiotic bacterium Lactobacillus fermentum strain JDFM216 or a vehicle. Immunomodulatory function was investigated using immune organs, immune cells and immune molecules in the mice, and gut microbiota was also evaluated in their feces. Notably, the L. fermentum JDFM216-treated group showed significantly better performance in the behavior tests (P < 0.05) as well as improved phagocytic activity of macrophages, enhanced sIgA production, and stimulated immune cells (P < 0.05). In aged mice, we observed decreases in species belonging to the Porphyromonadaceae family and the Lactobacillus genus when compared to young mice. While administering the supplementation of L. fermentum JDFM216 to aged mice did not shift the whole gut microbiota, the abundance of Lactobacillus species was significantly increased (P < 0.05). Our findings suggested that L. fermentum JDFM216 also provided beneficial effects on the regulation of immune responses, which has promising implications for functional foods. Taken together, L. fermentum JDFM216 could confer the benefit of improving health with enhanced cognition, physiological behavior, and immunity by modulating the gut microbiota.