It’s been a culinary staple the world over for a long time — we’re talking Ancient Egypt long.

Long also is the list of health benefits it’s said to have — we’re talking everything from alleviating athlete’s foot to reducing the risk of stomach cancer.

And now, you can add memory and gut health to that list.

It’s garlic.

And researchers at the University of Louisville say that eating the pungent herb helps counteract age-related changes in gut bacteria associated with memory problems.

“The diversity of the gut microbiota is diminished in elderly people, a life stage when neurodegenerative diseases such as Alzheimer’s and Parkinson’s develop and, memory and cognitive abilities can decline,” Neetu Tyagi, one of the research team leads, said in a release. “We want to better understand how changes in the gut microbiota relate to aging-associated cognitive decline.”

RELATED: Bacteria In Our Gut Could Be Key To Increasing Longevity, Researchers Say

For the study, Tyagi and her colleagues gave 24-month-old mice — the equivalent of 56 to 69-year-old humans — oral doses of allyl sulfide, a compound in garlic known for its boon to health. These mice ended up having better long- and short-term memory and healthier gut bacteria than their fellow elders who didn’t receive the allyl sulfide.

Those mice receiving allyl sulfide also had more hydrogen sulfide gas in their gut — and this gas is one you’ll want as it helps prevent intestinal inflammation.

The findings are just the latest to link the health of our microbiome — the collection of bacteria in our gut — with age-related ailments including dementia, diabetes and cardiovascular disease.

The team is continuing their research in order to better understand the relationship between the gut and cognitive decline. And they’re also looking at how garlic might be used as a treatment in the aging population.

WATCH: How to peel garlic in bulk super fast

RELATED: Recipe: Garlicky Shrimp and Snow Peas