A new study shows that maintaining a lifelong commitment to exercise may be one of the best ways to stay active in your 60s, 70s, and beyond. Here’s how to make this happen.

Men who are physically active in their 40s and 50s are more likely to stay active as they get older.

That’s according to new research.

It sounds good on paper.

But if you want to know what this looks like in real life, you only have to look as far as 82-year-old John Berg.

This past year Berg competed in 18 events at the Senior Games in North Carolina, including running, swimming, cycling, and shot put.

He took home 13 gold medals and two silver.

Although Berg works hard to achieve these results on the track and field — and in the pool — he’s been laying the groundwork for decades.

“Through high school and college, I ran track,” Berg told Healthline, “and that stayed with me as I aged. Running three miles a day during my lunch break, and running in 5K and 10K races.”

A 2017 study published in the journal BMJ Open found that this kind of lifelong commitment to exercise seems to help men stay active in their 60s and 70s.

To understand how men’s physical activity changed as they aged, researchers followed more than 3,400 men for 20 years — starting when the participants were between 40 and 59 years old.

Over the course of the study, around two-thirds of the men were physically active.

Also, at each of the check-ins — at 12, 16, and 20 years — around half of the men reported participating in one or more sports.

This includes team sports like soccer and hockey, as well as bicycling, running, working out at the gym, hiking, skiing, and similar activities.

Men who were physically active at the start of the study were nearly three times as likely to still be active 20 years later, compared to those who had lower activity levels.

This was also true for men who had participated in sports during mid-life.

Overall, the longer men played sports, the more likely they were to stay active.

At the high end, men who had 25 years of sports under their belt at the start of the study were almost five times as likely to be physically active by the end of the study.

Levels of walking also increased over the course of the study — from 27 percent of men to 62 percent — possibly due to men having more free time in retirement, the researchers said.

But recreational activities such as gardening and do-it-yourself activities dropped sharply from 56 percent of men to 40 percent by the end of the study.

Researchers think this may be the result of declines in physical functioning and the onset of chronic disease as men aged.

Because the study was done on men, the results may not apply to women.

But women like Kittie Weston-Knauer, 69, prove that the potential for lifelong physical activity is real for them, too.

Weston-Knauer has always been athletic and active — in spite of having osteoarthritis since her 20s.

“I didn’t let the pain stop me from playing, being active, and doing what I loved to do,” she told Healthline.

When Weston-Knauer was 40 years old, she started BMX racing after her son challenged her and his father to a race.

Weston-Knauer has been racing ever since — and still riding through the pain.

Recently, though, that all changed.

“I knew it was time for me to do something about my pain, so I found a doctor who recommended knee and hip replacements to compete stronger and harder,” she said.

Weston-Knauer said her doctor credits her active lifestyle — “even when my knees and hips were literally bone on bone” — with helping her recover faster after surgery.

Although osteoarthritis can occur in people of all ages, it’s most common in those older than 65 years.

But it’s not the only age-related change that can keep people from being physically active.

As we get older, our skin, tendons, and ligaments become less elastic, which can lead to stiffer joints.

We may also lose muscle mass and see a drop in our aerobic fitness. Plus, our reaction times may slow down.

Combined, these kinds of physiologic changes can increase your risk of injuries such as muscle strains and joint problems, all of which can derail your fitness program.

Many of these changes are noticeable.

“As I have aged — going into year 30 with the sport — what I have found is that I don’t have the same agility as I once had, and racing or just riding is not enough,” said Weston-Knauer.

Even though we can’t turn back the clock on our bodies, becoming sedentary past middle age is not a given.

“There are things that happen as we age that are normal, but it doesn’t necessarily translate to being frail,” Dr. David Kruse, a sports medicine specialist with Hoag Orthopedic Institute in California, told Healthline.

Kruse said a big goal for people wanting to stay active as they age should be avoiding injuries.

For some people, this may mean choosing “less impactful activities and less injury-prone activities.”

For example, a hockey player might take up swimming. Or a runner might switch to bicycling.

“You can also try to sustain the things that you enjoy doing, that you have a passion for,” said Kruse. “But you have to balance them out with more time spent cross-training and building a base of fitness.”

This approach has helped Berg keep competing.

“I now focus more on yoga or isometrics to stay limber and strong, things that are easier on my body and don’t strain my joints,” said Berg. “With SilverSneakers [fitness program for seniors], I also focus on balance exercises to help improve my stability.”

Staying active is important at any age.

But older adults may need to be more diligent in choosing the right kinds of physical activities.

“As you age, a comprehensive program should be the focus,” said Kruse.

He said this includes resistance or weight training to maintain lean muscle mass and joint stability. And activities that promote flexibility such as Pilates, yoga, tai chi, and stretching programs.

Kruse also recommends activities that improve balance as well as ones that get your heart rate up.

“The better your aerobic fitness, the stronger you will be,” said Kruse, “and the better outcomes you’ll have with your resistance training, as well as a greater ability to sustain other sport-related activities.”

People who have been competitive athletes for much of their lives may have a harder time adjusting to the age-related changes in their body.

“It’s very easy for them to just want to maintain the way they’ve always done it,” said Kruse. “They may not realize that these normal physiologic changes do happen over time and they do have to adapt to them.”

He added that athletes can still be successful as they age. But they need to constantly look at their training program, and adjust it in order to maintain a solid fitness base and prevent injuries.

For Weston-Knauer, this means balancing BMX racing with other activities.

“I do a lot of TRX training, and work with a trainer to help build a routine that uses my body to build strength, stability, and flexibility,” she said. “This has helped me compete at a higher level.”

She also skips the fried foods and walks at least three miles, five days a week.

Berg is also mindful of what he eats.

“As I’ve aged, I’ve focused on eating healthy,” he said. “I grow a lot of my own food in my garden, including kale, lettuce, tomatoes, and asparagus. This helps fuel my body and keep me going.”

What about if you find yourself approaching your 60s and haven’t really started being active?

Don’t worry, it’s not too late.

“If your goal is to be fit, to work on joint strength, for general fitness or for stress relief,” said Kruse, “those are very achievable goals that you can implement at any age.”

Sometimes your goals may be more than just fitness.

“Staying active allows me to continue to live an active life,” said Berg, “to continue my hobbies of gardening, wood carving, singing in the choir and a barber shop group, playing the ukulele, and ballroom dancing.”

Weston-Knauer suggests that people wanting to be more active find an activity that is a “passion” for them.

For her, it’s cycling. But for others it might be pickleball, softball, or maybe even walking with their children or grandchildren.

“Our bodies were built to move,” she said, “and if we don’t continue to move, our bodies will feel it, and I believe our minds will feel it, too.”