The toddler’s mother is grateful that her son will now be able to live more like a regular kid.

Xavier Hames with his mother Naomi. (Screenshot courtesy of Fairfax Media)

Xavier Hames with his mother Naomi. (Screenshot courtesy of Fairfax Media)

Xavier Hames, a four-year-old boy from Perth, Australia, will be sleeping much more soundly through the night — and so will his parents. That’s because the toddler, who has lived with the complications associated with type 1 diabetes since he was 22 months old, recently became the first person in the world to receive an artificial pancreas.

The artificial pancreas includes a sensor that determines Xavier’s blood sugar levels and communicates that information to an insulin pump, which is implanted under the toddler’s skin. The whole thing is driven by an algorithm that predicts in advance when his blood sugar levels will get slow and responds by stopping the flow of insulin before that happens, according to IFLScience.

With the device in place, Xavier will be able to sleep restfully through the night — and his parents won’t need to check his blood sugar during the day either.

The implanted insulin pump helps to avoid the serious consequences of low blood sugar (also referred to as hypoglycemia) typically associated with type 1 diabetes; these include seizure, coma and potential death. Without the pump implanted in his body, Xavier — like 371 million people around the world living with type 1 diabetes — would need to have his blood sugar monitored as often as four to eight times a day and take insulin shots when his blood sugar is too low, according to the Mayo Clinic.

The pump, which costs $8,100, will need to be replaced in four years. This device, which was developed based on research by the Juvenile Diabetes Research Foundation, underwent clinical trials for five years in hospitals in Australia before it became available for purchase in that country. While the artificial pancreas is not yet available here in the U.S., the FDA has approved a clinical trial of the device; it’s expected that the device will be available here within the next two years, according to USA Today.

“The majority of hypoglycemic attacks occur at night when a person is asleep and they might not be able to react or recognize the attack,” Tim Jones, clinical professor at Princess Margaret Hospital in Perth, told The West Australian. “This device can predict hypoglycemia before it happens and stop insulin delivery before a predicted event. This, coupled with the fact that the pump automatically resumes insulin when glucose levels recover, is a real medical breakthrough.”

In addition to being able to sleep through the night herself, the toddler’s mother is also grateful that her son will now be able to live more like a regular kid, and occasionally have pasta or even snack foods, according to IFLScience. Her son may even be able to go swimming, since the device is waterproof.