Exercise works all kinds of wonders on the human body, from stabilizing joints to improving muscle mass to reducing inflammation. That’s pretty motivating when your body feels good—but less so when it aches. 44% of people with arthritis say they don’t exercise, and close to 80% aren’t active enough.

But a recent randomized controlled trial published in the Journal of Rheumatology finds that people with arthritis who practice yoga can reap impressive physical and mental benefits. Those who practiced yoga three times a week had an improvement in pain levels, energy, mood and physical health compared to the group that didn’t do yoga—and the effects lasted even nine months later.

“There’s kind of a myth that says if you have arthritis, the good thing to do is to rest your joints,” says one of the study’s authors Dr. Clifton O. Bingham III, associate professor of medicine at Johns Hopkins University School of Medicine and director of the Johns Hopkins Arthritis Center. “I think the study is more evidence that, in fact, that’s not true.”

In the trial, the researchers recruited 75 adults who didn’t exercise and had rheumatoid arthritis, a condition that affects the body’s smaller joints like the wrists, feet and ankles, or knee osteoarthritis, which is localized to the knee. One group practiced a specialized kind of yoga for eight weeks: group classes modified by arthritis experts to take the stress off of joints. Each hour-long class took place twice a week, and the people in the group were told to do a weekly class at home. The other group exercised as usual.

MORE: Yoga Is Just As Safe As Other Exercise, Study Finds

After eight weeks, the people in the yoga group saw improvement across all measures compared to the control group. Their physical health, flexibility, pain levels, walking capacity and depression scores were better. The benefits lasted nine months later, when researchers checked up on them again.

Some of the people in the yoga group are Bingham’s patients and still doing yoga five-plus years later, he says. “It really has been transformative for a lot of my patients,” he says. “What [one patient] learned from the yoga experience was the philosophy of non-harming and the idea that where she is today is good enough,” Bingham says. “Those types of things are very difficult to measure in terms of an outcome from a study, but we certainly saw them on a real one-on-one patient level.”

Not every yoga class is safe for people with arthritis, Bingham says, and he advises people to consult with their arthritis specialist before starting. It’s important to also ask the yoga teacher if they have experience dealing with the disability, he says. Gentle yoga, prenatal yoga or classes designed for an older or disabled population are good places to start.

The results of the study suggest that gentle yoga can be a safe practice for people with arthritis, and that it doesn’t make symptoms worse—in fact, quite the opposite. “You can carefully and cautiously exercise and do activities,” Bingham says. “Yoga, in the way that we’ve done it, can be one of those.”

Get our Health Newsletter. Sign up to receive the latest health and science news, plus answers to wellness questions and expert tips. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Mandy Oaklander at mandy.oaklander@time.com.