Researchers analyzed data on more than 44,000 women participating in a long-term study and found those who ate the most fiber during high school and early adulthood were about 20 percent less likely to develop breast cancer by middle age than those who ate the least fiber in their youth.

There’s reason to believe that dietary fiber could affect developing breasts in ways that impact long-term cancer risk, but no one has ever followed-up over such a long period, the authors note in the journal Pediatrics.

“Most of the studies that evaluated association between dietary fiber intake in midlife or later, have not noted any significant association,” said lead author Maryam Farvid of the Harvard T.H. Chan School of Public Health in Boston. “Therefore, it seems high-fiber diet in early life would be important in terms of breast cancer prevention.”

Foods high in fiber contain many other nutrients, which may have played a role, but most known breast cancer risk factors as well as the overall quality of the women’s diets were taken into account, Farvid said. Yet the association with fiber remained.

The researchers used data from the Nurses’ Health Study II, which included more than 90,000 premenopausal women who completed a dietary questionnaire in 1991, when they were 27 to 44 years old. Eight years later, 44,263 of them also completed a questionnaire about their diets when they were in high school.

Among women with high school dietary data, there were 1,118 cases of invasive breast cancer by 2011.

The study team divided women into five groups, from highest to lowest intake of dietary fiber when they were teens and also in 1991, when they were young women.

Those who ate the most dietary fiber when they were young were 16 percent to 20 percent less likely to develop breast cancer than those who got the least fiber.

This was true for soluble fiber in foods like oat bran, which attracts water and slows digestion, and insoluble fiber in foods like wheat bran, which adds bulk to stool and helps food pass more quickly through the digestive tract.

In early adulthood, women who got the least dietary fiber consumed an average of 12 grams per day, compared to 26 grams per day for those who got the most fiber, and amounts were similar among the teens.

While the average American today eats 10 to 15 grams of fiber daily, most should be getting 20 to 35 grams daily, according to the National Library of Medicine.