(CNN) Yet more bragging rights are in for the Mediterranean diet, long considered to be one of the healthiest in the world .

A new study published Monday in the BMJ journal Gut found that eating the Mediterranean diet for just one year altered the microbiome of elderly people in ways that improved brain function and would aid in longevity.

The study found the diet can inhibit production of inflammatory chemicals that can lead to loss of cognitive function, and prevent the development of chronic diseases such as diabetes, cancer and atherosclerosis.

"Our findings support the feasibility of changing the habitual diet to modulate the gut microbiota which in turn has the potential to promote healthier aging," the study authors said.

Role of the microbiome

About 60 tons of food pass through the average human's digestive tract in a lifetime, science says , exposing our insides to billions of different bacteria in addition to those we were born with. Many of those miniscule creatures play important roles -- good and bad -- in how well we absorb nutrients; the functionality of our immune response; and our energy and metabolism levels.

Science has shown that as we age, the types and amount of microbes found in the gut are reduced. A poor diet is especially common among the elderly in long-term residential care and those who live alone. Health and dental issues can also make it difficult for the elderly to eat a well-balanced diet.

As the diversity of bacteria diminishes, " inflamm-aging" occurs, contributing to age-related inflammatory processes that can lead to cancer, neurological disorders and other diseases.

Change occurred within 12 months

The study analyzed the gut microbiome of 612 elderly people from France, Italy, the Netherlands, Poland, and the United Kingdom before putting 323 of them on a special diet for a year.

While the diet was designed for the elderly, it was based on the Mediterranean principles of eating lots of fruits, vegetables, nuts, legumes, olive oil and fish, and little red meat, sugar and saturated fats.

The rest of the 65- to 79-year-olds in the study were asked to continue to eat as they always did for the same 12 months.

After the year was over, those who had followed the Mediterranean diet saw beneficial changes to the microbiome in their digestive system. The loss of bacterial diversity was slowed, and the production of potentially harmful inflammatory markers such as C-reactive protein and interleukin-17 were reduced.

At the same time, there was a growth of beneficial bacteria linked to improved memory and brain function, the study said. The diet also appeared to boost "keystone" species, critical for a stable "gut ecosystem" and which also slowed signs of frailty, such as walking speed and hand grip strength.

Nationality did not appear to matter. The findings were similar and consistent no matter where the people lived and no matter their age or weight, both of which influence the unique makeup of a person's microbiome.

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

The study is part of a larger randomized controlled trial of 1,200 people called the European Project on Nutrition in Elderly People or NU-AGE that began in 2012. Previous publications from the ongoing study found those who followed the diet closely had improved episodic memory and overall cognitive ability. Higher adherence to the diet also reduced the rate of bone loss in people with osteoporosis and improved blood pressure and arterial stiffness.

Benefits of the Mediterranean diet

Discovering that the Mediterranean diet could affect the microbiome in a positive way isn't really surprising; the diet already has a stuffed shelf of scientific trophies. It's won gold medals in reducing the risk for diabetes, high cholesterol, dementia, memory loss, depression and breast cancer. Meals from the sunny Mediterranean region have also been linked to stronger bones, a healthier heart and longer life. Oh, and weight loss, too.

The diet features simple, plant-based cooking, with the majority of each meal focused on fruits and vegetables, whole grains, beans and seeds, with a few nuts and a heavy emphasis on extra virgin olive oil. Say goodbye to refined sugar and flour except on rare occasions. Fats other than olive oil, such as butter, are consumed rarely, if at all.

Meat can make a rare appearance, usually only to flavor a dish. Instead, meals may include eggs, dairy and poultry, but in much smaller portions than in the traditional Western diet. Fish, however, are a staple.

"It's more than a diet, it's a lifestyle," said Atlanta registered dietitian Rahaf Al Bochi in an earlier interview.

"It also encourages eating with friends and family, socializing over meals, mindfully eating your favorite foods, as well as mindful movement and exercise," said Al Bochi.