The so-called "bionic pancreas" is the latest in the search to improve the lives of people who have type 1 diabetes, which means their bodies do not produce insulin, a hormone that regulates blood sugar.
Three million people in the United States have type 1 diabetes, which is far less common than type 2 diabetes. It is commonly known as juvenile diabetes because it tends to appear in children and young adults.
People with type 1 diabetes must prick themselves for blood samples multiple times daily in order to monitor their glucose levels, and then either inject insulin or receive it from a pump.
The new method involved an iPhone 4S, which ran a control algorithm for insulin and glucagon, combined with a tiny needle that is inserted under the skin to monitor real-time glucose levels.
A total of 52 adults and youths tried the combination for five days.
The patients using the bionic pancreas had fewer interventions for low blood sugar and showed "significant improvements" in overnight blood glucose levels over what they experienced normally, said the researchers.
"The bionic pancreas system reduced the average blood glucose to levels that have been shown to dramatically reduce the risk of diabetic complications," said researcher Steven Russell, assistant professor of medicine at Massachusetts General Hospital.
"This is tremendously difficult with currently available technology."
More research is needed before the device can be made available for sale, the authors said.
The findings were published Sunday in the New England Journal of Medicine.