The device improved the amount of time patients spent overnight with blood sugar in the ideal range by 13.5%.
A group of 24 adults with Type 1 diabetes used the machine each night for four weeks in their own homes. It was the first time in the world such a device has been used for more than a couple of days without medical supervision.
The artificial pancreas is worn outside the body and linked to a glucose sensor under the skin.
Blood sugar levels are measured and the information transmitted to an insulin pump, which releases just the right amount of the hormone into the body.
Participants in the study, funded by the charity Diabetes UK, switched on the device after their evening meal and turned it off again before breakfast the next morning.
Every 12 minutes, the software adjusted the amount of insulin administered by the pump.
Lead researcher Dr Roman Hovorka, from Cambridge University, said: "The advantage of a 'closed-loop' system like this one is the ability to fine tune insulin delivery to account for variations in overnight insulin needs.
"The system was able to adapt and safely cope with these variations to achieve more consistent glucose control. Now that we've tested the system at multiple centres, we can see that its benefits apply to a wide range of individuals.
"A large-scale clinical trial of the artificial pancreas will now be the next step in helping to translate these exciting findings into an end product that will help to transform the management of Type 1 diabetes by achieving consistent glucose levels and reducing the risk of blood glucose levels falling dangerously low during the night.
"Such a product may be viable with existing technology."