Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

There’s more evidence that what’s good for your heart is good for your head. A new study shows that people who run, swim or do other moderate exercise have brains that look, on average, 10 years younger than the brains of couch potatoes.

"Our study showed that for older people, getting regular exercise may be protective, helping them keep their cognitive abilities longer," said Dr. Clinton Wright of the University of Miami , who led the study.

But it’s not necessarily easy. Walking, golf, bowling and yoga didn’t count, and people need to start before they begin showing memory loss, Wright’s team reported in the journal Neurology.

The study of nearly 900 people showed 90 percent fell into the low-intensity group.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The people are part of a larger group taking part in a bigger study called Northern Manhattan Study. They were asked how long and how often they exercised during the past two weeks. Seven years later, they were tested for memory and thinking skills and got a brain MRI.

Five years after that, they took the memory and thinking tests again.

The 10 percent who said they took part in moderate- to high-intensity exercise scored better on the tests 12 years later. These included running, racquetball, aerobics, or calisthenics.

“We found that those with moderate–heavy activity had higher baseline scores and slower decline in comparison to inactive patients,” the team wrote.

“The degree of decline was equivalent to the expected decline associated with approximately 10 years of cognitive aging.”

And if people already had signs of memory loss or mild cognitive impairment on their first exam,the exercise did not seem to help, the team found.

Many studies have shown that exercise may not prevent Alzheimer's but may delay it.

The findings fit in with a study that found two years of exercising, eating healthier food and brain training can boost people's memory function.

And other studies have shown that even moderate exercise, such as brisk walking, can help.