Women who develop diabetes while pregnant may be at elevated risk of also developing a dangerous build up of fat in their livers when they reach middle age, according to a new analysis.

The common risk factor for both gestational diabetes and non-alcoholic fatty liver disease, researchers say, is trouble making or using the hormone insulin to manage blood sugar, known as insulin resistance.

“We hope that early identification can promote healthy lifestyle changes that prevent or slow disease progression,” said lead author Dr. Veeral Ajmera of the University of California, San Francisco.

“Pregnancy stresses the body in many ways, one of which is the ability to manage blood sugar,” Ajmera said by email. “During pregnancy a woman’s body becomes more resistant to insulin, which is the hormone required to decrease the blood sugar.”

Insulin resistance is also “central to development of non-alcoholic fatty liver disease,” which affects 20 percent to 30 percent of adults in the western world, the study team writes in The American Journal of Gastroenterology. Non-alcoholic fatty liver disease is the most common chronic liver disease in the United States.

Fatty liver disease is often diagnosed later in life, Ajmera told Reuters Health. So the researchers used long-term data to see if diabetes during pregnancy made a woman more likely to develop fatty liver disease 25 years later.

The researchers analyzed information about 1,115 black and white women recruited between 1985-1986 in four cities across the United States who gave birth to at least one child.

He advocates changes in diet to avoid the insulin resistance that leads to diabetes and fatty liver disease. “Many women are obese – so it is a matter of reducing weight and eating sensibly,” he said.

Taylor-Robinson recommends eating fewer carbohydrates, more proteins and vegetables, and in particular, avoiding large amounts of fruit juice, which can contain a lot of sugar.

Ajmera also advised lifestyle changes, especially adding exercise. “We recommend either aerobic or resistance training for 30 minutes five times per week,” he said.

“There are consequences to obesity and this includes cirrhosis, liver cancer and heart disease,” Taylor-Robinson said. “Those people who become diabetic during pregnancy have strong risks of developing these complications later in life if attention isn’t given to weight, diet and exercise.”