The catch is that it must be around four hours after the learning has taken place, according to researchers at the Radboud University Medical Center in the Netherlands.
Indeed, the results found that people who exercised four hours after learning new material retained information better two days later than those who exercised either immediately after learning or not at all.
The study involved 72 participants learning 90 picture-location associations over approximately 40 minutes, before being randomly assigned to one of three groups.
The first group performed exercise immediately, the second performed exercise four hours later, and the third did not perform any exercise.
The exercise consisted of 35 minutes of interval training on an exercise bike at an intensity of up to 80% of participants' maximum heart rates.
Two days later, participants returned to see how much they remembered while their brains were imaged via magnetic resonance imaging (MRI).
The results showed that those who exercised four hours after their learning session retained the information better two days later than the other two groups.
The brain images also demonstrated that exercise after a time delay was associated with more precise representations in the hippocampus (an area important to learning and memory) when an individual answered a question correctly.
"Our results suggest that appropriately timed physical exercise can improve long-term memory and highlight the potential of exercise as an intervention in educational and clinical settings," the researchers said.
They added that it's not yet clear exactly how or why delayed exercise has this effect on memory.
However, previous studies of lab animals suggest that naturally occurring chemical compounds in the body known as catecholamines (including dopamine and norepinephrine) can improve memory consolidation. And one way to boost catecholamines is through physical exercise.
The findings are published in the Cell Press journal Current Biology.
Hitting the gym or playing a sport after learning will help boost memory.