Obese mothers who undergo weight-loss surgery could reduce obesity risks in their children when they're born, a new study shows.

The findings, published in the journal Proceedings of the National Academy of Sciences on Tuesday, observed specific genetic changes that happened after mothers have a gastrointestinal bypass surgery, emphasizing the influence of genes and lifestyle choices on a child's risk for obesity.

"The impact on the genes, you will see the impact for the rest of your life," Marie-Claude Vohl, lead author and researcher at Laval University in Quebec, Canada, told the Associated Press.

The researchers wanted to test the impact of weight-loss surgery on genetic markers that affect the baby's heart. They recruited 20 obese mothers between the ages 35 to 51 from Quebec City who had biliopancreatic diversion with duodenal switch surgical procedures. The children born to these women after surgery were slimmer than their older brothers and sisters.

The investigators had performed a genetic analysis on 25 offspring that were born after and compared it to the genetic markers in 25 siblings born before the mom's surgery. The analysis revealed almost 5,700 genes involved in heart disease and blood sugar metabolism were methylated, or chemically modified, to express genes differently. This meant that the younger siblings' genes had reduced risks of developing diabetes and heart disease because genetics were working differently than in their older siblings.

Previous studies have found that diet and exercise in mothers could help control weight for their children; now genetics are playing a huge role after weight-loss surgery.

Researchers believe that the chemical balance changed and influenced how genes began to function in the fetus in a healthier way.

They also wanted to stress that biology and environment both play an instrumental role during the early stages of development. Experts added that healthier eating habits play a significant role in improving obesity risks after weight-loss surgery.

The biliopancreatic diversion with duodenal switch is a procedure that reduces the size of the stomach and redirectes the digestive path, thereby decreasing consumption of food and calories. The women who participated in this procedure lost nearly 100 lbs.

Doctors say that overeating and gaining weight during pregnancy could put the child at risk of obesity and diabetes, suggesting that the average women at the beginning of pregnancy should gain between 25 and 35 lbs., while obese women should only gain up to 20 lbs.

Source: Guénard F, Deshaies Y, Cianflone K, et al. Differential methylation in glucoregulatory genes of offspring born before vs. after maternal gastrointestinal bypass surgery. Proceedings of the National Academy of Sciences. 2013.