In a quick approval, the U.S. Food and Drug Administration on Wednesday gave a green light to the first medical device for type 1 diabetes that can automate varying doses of insulin 24 hours a day using a real-time sensor and an advanced computer program that learns a patient’s personal needs.

Medtronic PLC’s MiniMed 670G “hybrid closed-loop” system received approval from the FDA just three months after the Minnesota-run device maker submitted its premarket application for approval. The application was based on data from a 10-site clinical trial that found 124 type 1 diabetes patients using the device stayed within their desired blood-sugar ranges for three months without any severe complications.

“The MiniMed 670G hybrid closed loop system, often referred to as an ‘artificial pancreas,’ is intended to adjust insulin levels with little or no input from the user,” FDA officials wrote Wednesday in announcing the first-of-its-kind device.

The pancreas is the organ that produces insulin to keep blood sugar called glucose in check. In type 1 diabetes, formerly known as juvenile diabetes, the immune system attacks cells in the pancreas that produce insulin, forcing the patient to inject insulin daily to stay alive. JDRF, an advocacy group for patients with the chronic disease, estimates 1.25 million Americans have type 1 diabetes, including 200,000 children.

Patient advocates and engineers have long wanted a device that could combine a glucose sensor, sophisticated programming and an insulin pump to automate the regulation of blood sugars before they can cause health problems like hypoglycemia, as a normally functioning pancreas does.

Medtronic doesn’t refer to the 670G as an artificial pancreas, but rather as a step toward a fully automated “closed loop” system requiring minimal patient interaction.

“It’s not the full artificial pancreas, where you put this on and you forget about your diabetes and it’s gone. But it’s a giant step,” said Dr. Richard Bergenstal, director of the Park Nicollet International Diabetes Center in Minneapolis and principal investigator of the 670G study. “The machine actually learns how much insulin you typically need in a day and it will give you more and less as the day goes on, depending on your needs. But you still need to interact with it.”

The device includes three components — a sensor worn on the hip, an insulin pump the size of a cellphone that is worn on the body, and an “infusion patch” on the skin connected by a thin tube to the insulin pump that delivers the drug. The device is approved for people aged 14 and older, but clinical work is ongoing to gather evidence on safety in patients aged 7-13. Medtronic plans to roll out the 670G commercially in the spring.

John Caldwell, 45, of Hopkins, participated in the study and said he was happy with how the system worked.

He noted a stark improvement in the mornings. With other pump systems, he used to wake up with high blood sugars and then spend the rest of his day trying to get into his target range while managing everything else he had to do in a typical day.

“Now I wake up in the morning, and my blood is always within target range, just about,” Caldwell said. “It lets you start your day out right.”

The 670G uses the newly approved Guardian Sensor to take readings of the person’s blood-glucose levels every five minutes, plus a computer program Medtronic calls SmartGuardHCL, which uses real-time trends and historical data to decide whether to increase or decrease insulin doses.

Users still need to manually enter the amount of carbohydrates they eat so the machine can compensate, and they need to manually accept dose corrections. The sensor needs to be manually calibrated periodically, and have its battery changed after seven days.

The pivotal study of the system found that patients stayed in their desired ranges for blood sugars 73 percent of the time, compared to 68 percent for the same patients who used a pump with less automation. During sleeping hours, patients with the 670G stayed in their target ranges 76 percent of the time, compared to 67 percent with the less-advanced system.

Bergenstal said some parents of children in the study reported their first full nights of sleep since their kids’ diagnoses.

“They typically get up twice a night, check their kids’ blood sugar and make sure they’re safe. And now, with this system, they were confident that they could go to bed at night and this system would just ease the blood sugar down to an excellent blood sugar in the morning, and do it safely,” he said.

Just last month, Medtronic received FDA approval for a less-advanced system called the 630G.

When the company filed its application for the more-advanced 670G last June, it wasn’t clear when that approval would happen, company executives told stock analysts last month in an earnings conference call. The 630G replaces the 530G, which had been on the market for three years.

On Wednesday, a Medtronic statement said people with 630G systems will be eligible for a “priority access program” for the 670G, “as their experience with our newest hardware platform will facilitate an optimal transition.”