Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Here’s a good reason to check what your kids are eating: women who remember having eaten poorly as teenagers were more likely to develop early breast cancer, researchers reported Wednesday.

They found women who ate the most inflammatory diet – heavy in red meat, sodas, sweet foods and white flour – were up to a third more likely to develop breast cancer in their 20s, 30s or 40s compared to women who thrived on salads and whole grains.

Teens eating hamburgers Brooke Auchincloss / Getty Images stock

It doesn’t mean that breast cancer is a woman’s fault, but it does show that what you eat early in life could have repercussions decades later, said Dr. Karin Michels of the University of California Los Angeles, who helped lead the study.

“It is actually quite serious,” Michels, who did the work while at Harvard Medical School and Brigham and Women’s Hospital, told NBC News.

“We should advise our girls and teenagers to eat healthy because breast cancer does seem to have a much earlier origin than we have appreciated in the past. Cancer in general takes years, potentially even decades, to develop.”

Breast cancer is the No. 2 cancer killer of U.S. women, after lung cancer. Every year, it's diagnosed in 200,000 women and a few men, and kills around 40,000.

Related: Obesity Raises the Risk of 11 Cancers

For the report, Michels and colleagues turned to the Nurses Health Study, a giant, ongoing look at the health of tens of thousands of women working in medicine.

“In 1997, participants were asked if they would be willing to complete a supplemental food frequency questionnaire about diet during high school.” That’s one weakness of the study – it required women to remember what they ate decades before.

"Cancer in general takes years, potentially even decades, to develop.”

The researchers threw out results from anyone whose memories seemed especially bad and were left with 45,000. Of them, 1,477 developed breast cancer over the next 22 years including 870 who developed premenopausal breast cancer.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

They divided the women into quintiles – five groups based on how many “inflammatory” foods they ate and how often. These include sugar-sweetened and diet soft drinks, refined grains, red and processed meat, margarine, corn, other vegetables, and fish.

The opposite of an inflammatory diet includes green leafy vegetables, cruciferous vegetables such as cabbage and broccoli, and coffee.

“Among all women there was no significant association between a higher inflammatory dietary pattern score in adolescence and overall breast cancer incidence,” they wrote in the journal Cancer Research.

“A healthy lifestyle early on is much, much more important than we appreciated."

“However, a significant association was observed between a higher adolescent inflammatory dietary pattern score and incidence of premenopausal breast cancer.”

Women who remembered having eaten a very highly inflammatory diet as teens were 35 percent more likely to develop premenopausal breast cancer than women who ate the least inflammatory diet, they found.

And the more inflammatory foods a woman ate, the higher her risk, Michels said.

They did not break down the diet by individual foods, Michels said, so they cannot tell women that, say, dropping red meat will help even if they continue to drink soda.

Related: Exercise Helps Breast Cancer Survivors Live Longer

“Every step helps. It is just like with physical activity,” Michaels said. “People ask, ‘do I have to go to the gym three hours a day’ and the answer is any activity is better than none.”

It’s the same with food, she said.

“Personally, I am a vegetarian, so I think giving up red meat is a good first step,” she said. “Others may find it easier to give up refined carbohydrates.”

Going healthy later in life does not seem to help as much as starting out eating well, Michels said. And women whose diet worsened as they entered middle age did not seem to raise their riskof later breast cancer.

Related: How to Lower Your Breast Cancer Risk

“A healthy lifestyle early on is much, much more important than we appreciated,” Michels said.

“Now we have to communicate to girls.”

Many studies have linked diet to the risk of various cancers, and another study published Wednesday found obesity raises the risk of 11 cancers, including breast cancer.

This study can not definitively show eating poorly as a teen causes breast cancer. To show that, researchers would have to randomly assign large numbers of teenagers to eat different diets and then watch what happened for 20 years -- something that's clearly unworkable.

And it's possible that teens who ate better had other lifelong healthy habits. Either way, there are many benefits to eating less refined flour, sugar and red meat and more vegetables and the srtudy shows that doing so early in life can only help.

Separately, a team at the Ohio State Comprehensive Cancer Center found that obesity itself changes the genes in a way that raises the risk of breast cancer. They looked at fat tissue from women undergoing breast reduction surgery.

About 30 percent of breast cancer cases can be linked to genetics. Food is something people can control, Michels said.