Premature babies are at increased risk for diabetes, a large new study reports.

In previous studies, preterm birth has been associated with insulin resistance, but this is the first large study to track the risks of diabetes from childhood into adulthood.

The researchers followed 4,193,069 singleton babies born in Sweden from 1973 to 2014 for an average of 23 years, some as long as 43 years. They found 27,512 cases of Type 1 diabetes, and 5,525 cases of Type 2. The study is in Diabetologia.

Compared with full-term babies, those born prematurely had a 21 percent increased relative risk for Type 1 diabetes and a 26 percent increased risk for Type 2 before age 18. After 18, premature babies had a 24 percent increased relative risk for Type 1 and a 49 percent increased risk for Type 2. Premature girls were at slightly higher risk than boys.

The study controlled for maternal age, education, body mass index, smoking, diabetes during pregnancy and other factors.

“Most children born preterm do well over time, but they have modestly increased risks for various disorders,” said the lead author, Dr. Casey Crump, a professor of family medicine at the Icahn School of Medicine at Mount Sinai in New York. “Children and adults who were born prematurely may need earlier screening and clinical follow-up for diabetes, and more aggressive lifestyle interventions to help prevent it.”