We all know that regular exercise can have dramatic effects on our physical health, as it helps protect us from preventable diseases, but what about our minds? The effects of physical fitness may extend beyond disease and obesity prevention, potentially impacting our intelligence from before birth well into old age.

READ MORE: Prevent common diseases by getting these free screenings

Research on exercise and brain health

For fitness and brain health, the benefits may come early—perhaps as early as in the womb. A 2013 paper made a splash in health media when it claimed active pregnant mothers gave birth to smarter babies.

READ MORE: How much does it cost to have a baby?

A review published in the CDC’s journal Prevention of Chronic Disease indicated that although longer-term and larger trials are needed, aerobic activity in children “is positively associated with cognition, academic achievement, behavior and psychosocial functioning outcomes.”

Some of the benefits of exercise (such as weight loss) come slowly and through repetition. But some research indicates the benefits of exercise on brain health and intelligence could come far more quickly.

One study, published in 2013 in the Journal of Clinical and Diagnostic Research, found that a single 30-minute session of moderate-intensity exercise could improve memory, planning, and reasoning, and shorten the amount of time needed to complete cognitive tests.

Similar research on 21 young adults identified increases in memory accuracy and recall speed following a half-hour workout, regardless of whether the exercise was aerobic or strength training.

How exercise affects the brain

Attempting to explain how acute exercise delivers these benefits, researchers from the University of Illinois analyzed 20 undergraduates and found a 30-minute treadmill workout increased neuroelectric activity and resulting cognitive functions, like reasoning and problem solving.

READ MORE: What does an MRI cost at your local hospital?

But neuroelectric activity is only part of the answer. Scientists have determined that exercise increases production of beneficial hormones like brain-derived neurotrophic factor (BDNF), for example. BDNF boosts communication between brain cells and stimulates the growth and development of blood vessels and neurons in the hippocampus, the region of the brain responsible for forming and organizing memories.

Several studies have linked exercise and the increased production of BDNF to increased hippocampal volume. The hippocampus, incidentally, shrinks with age and is the region of the brain that suffers the first and most profound damage when someone has Alzheimer’s disease.

Effects of exercise on brain health as we age

Earlier this year, researchers revealed findings that pointed at physical exercise in young adulthood improving cognition later in life. “Better verbal memory and faster psychomotor speed at ages 43 to 55 years were clearly associated with better CRF [cardiorespiratory fitness] 25 years earlier,” they concluded.

READ MORE: Scientific ways to get energized, naturally

Researchers with King’s College London collected data on more than 9,000 people and found those who exercised at least once per week performed better on cognitive tests at age 50 than those who did not.

And much of the research indicates you can’t be too late to the party. Physical activity in midlife can reduce the risk of dementia in old age, according to the University of Eastern Finland. And a meta-analysis of 30 randomized control trials found exercise to have cognitive benefits for adults already suffering from dementia.

Shortcomings in the research

As with any growing field of study, the research is varied both in quality and results. Several of these studies involved very small groups of participants; others were limited in time and scope, or relied on participants to self-report their exercise habits. The research on fit pregnant mothers giving birth to smarter babies was criticized because it was promoted before even being accepted into a peer-reviewed journal.

Perhaps the best evidence for exercise and intelligence comes from firsthand experience.

“Working out, for me, allows me to focus on what I need to do and block out distractions,” says LeeAnn Dillon, a fitness competitor and personal trainer from Raleigh, North Carolina, who spends an average of 10 hours in the gym each week when not training for a competition. And as a single mother who recently decided to go back to school, she relies heavily on focus and problem-solving.

People who exercise regularly report being better able to focus and perform on the days they work out; they report less stress and higher energy levels. “I think about… what bill needs to be paid, what my sons need, even the decision to go back to school while I’m working out,” Dillon says. “And in addition to giving me better focus, it gives me the confidence to take on new challenges.”

Elizabeth Renter writes for NerdWallet Health, a website that helps people reduce their medical bills.