Sidelined by achy knees? The key to avoiding pain might be on your plate: People with a fiber-rich diet are less likely to experience knee arthritis, new research in the journal Annals of the Rheumatic Diseases discovered.

Researchers analyzed data from two separate studies: The first, the Osteoarthritis Initiative (OI), included nearly 5,000 participants; the other, the Framingham Offspring cohort, comprised more than 1,200. They discovered that the more fiber people ate, the less knee pain they reported, and the less likely they were to be diagnosed with knee arthritis. (Here are four ways young, healthy guys are wrecking their knees.)

In fact, in OI study, those who ate the most fiber per day—an average of just over 20 grams (g)—were 30 percent less likely to have symptoms of knee arthritis and 19 percent less likely to report worsening pain in their knees over the course of four years than those who ate the least fiber, or just under 9 g per day.

In the Framingham study, those who ate the most fiber per day—nearly 26 g—were 61 percent less likely to experience symptomatic knee arthritis than those who ate the least, or just under 14 g.

In both studies, eating more cereal fiber was linked to lower levels of knee pain, too.

While the study can’t prove that fiber actually causes the reduction in knee pain, it seems that there is something about the nutrient that is protective: Even after the researchers adjusted for potential factors that may be skewing the relationship—say, that people who eat more fiber tend to have healthier diets overall—the link still remained.

The researchers believe fiber helps protect your knees in a couple of ways: Fiber reduces levels of an inflammatory protein called CRP, and increases satiety, which prevents you from overeating. That’s important, since there’s a strong link between knee arthritis and obesity—along with adding load to your joints, extra fat also increase inflammation, which is linked to pain.

The average guy currently takes in about 19 g a day, which is half of the recommended amount, as we reported.

Your move, then, is to work on getting more fiber in your diet—the more you eat, the more your risk of knee arthritis decreases, even if you aren’t taking in the maximum amount that the people in the study did.

Focus on making whole or minimally-refined sources predominant parts of your diet, says Men’s Health nutrition advisor Alan Aragon, M.S. That means fibrous vegetables like broccoli or Brussels sprouts, beans and legumes, and oats and quinoa.