An artificial pancreas given to pregnant women with diabetes could save mothers' lives and improve the health of their babies, researchers say.
Hormonal changes during pregnancy coupled with diabetes make regulating sugar levels difficult, which can have damaging consequences.
The Diabetes Care research shows an artificial pancreas can keep sugar at normal levels.
Diabetes UK, which funded the work, said it could make pregnancy safer.
Pregnancy worriesPeople with Type 1 diabetes are unable to control their blood sugar levels because their pancreas stops producing insulin.
It is a fatal condition which can be controlled by regular insulin injections, but that becomes much more complicated during pregnancy.
The safe range for blood sugar levels is much narrower then, and high or low levels which would be fine for an adult can damage a baby.
Dr Helen Murphy, from Cambridge University, told the BBC: "Half of all babies born to mothers with Type 1 diabetes are overweight or obese at birth because of too much sugar in the blood".
An earlier study of pregnant women in England, Wales and Northern Ireland showed the rate of stillbirths and deaths in the first week was four times greater in women with Type 1 diabetes, affecting 32 out of every 1,000 pregnancies.
Pregnancy can also be dangerous for the mother, who can end up with lower blood sugar levels and sometimes lose the warning signs for potentially fatal hypoglycaemic attacks.
During pregnancy, women with Type 1 diabetes spend 10 hours every day with sugar levels outside those recommended.