WASHINGTON (AP) — Federal regulators have approved a first-of-a-kind “artificial pancreas,” a device that can help some diabetes patients manage their disease by constantly monitoring their blood sugar and delivering insulin as needed.

The device from Medtronic was approved Wednesday for patients with Type 1 diabetes, the kind usually diagnosed during childhood. About 5 percent of the nation’s 29 million Americans with diabetes have this type.

Type 1 diabetes patients now have to manage their insulin through multiple injections throughout the day or a drug pump that delivers it through a tube. Their own pancreas doesn’t make insulin, a hormone needed to turn food into energy. They face increased risks of dangerously high blood-sugar levels, heart disease and many other health problems.

The new MiniMed 670G consists of a drug pump, a sensor that measures blood sugar and a tube that delivers the insulin. The sensor measures sugar levels every 5 minutes, infusing or withholding insulin as needed. Patients still have to manually increase insulin before meals.

Older insulin pumps simply deliver a baseline level of insulin, and patients must monitor their sugar levels and give themselves more insulin to keep their blood sugar from getting too high. A big danger is having too much insulin in the body overnight, when blood-sugar levels naturally fall. People can go into comas, suffer seizures and even die.

The Food and Drug Administration said it approved the device based on a three-month study of more than 120 patients. The study reported no major adverse events, such as dangerously low blood sugar, showing that the device is safe for those 14 years and up, regulators said in a release.

The pump is about the size of a cellphone and can be worn on a belt.

The device “can provide people with Type 1 diabetes greater freedom to live their lives,” said Dr. Jeffrey Shuren, director of the FDA’s device center.

The agency said it is requiring Ireland-based device manufacturer Medtronic to further study the implant’s performance in patients. The company is also studying the device for potential use in children ages 7 to 13.