Beverly Hospital has been given a hefty $1 million grant to treat pregnant women struggling with addiction — part of a state effort to cut spending on the skyrocketing number of drug-exposed babies and spread the burden of treating the opioid epidemic’s tiniest victims from Boston to regional hospitals.

“Most of the resources are in Boston. Many people from here are trucking into the city to get treatment and care,” said Dr. Melissa Sherman, an OB-GYN physician at Beverly Hospital. “It’s very expensive care. The overarching goal is to cut down cost of babies. Most of these women are on Medicaid, so it’s state money.”

Lahey Health’s Beverly Hospital treated 68 babies in the past two years who were born with neonatal abstinence syndrome, a result of drug exposure while in the womb. Sherman said the average length of stay for each baby is 20 days, which amounts to $30,000 — more than $2 million over two years.

The grant program — slated to launch late winter or early spring — aims to reduce the number of drug-addicted babies and cut their length of stay by combining prenatal services, suboxone and methadone treatments, and counseling for their mothers.

Beverly Hospital is one of three community institutions receiving grants from the Massachusetts Health Policy Commission, a state agency charged with monitoring health care costs.

Lawrence General Hospital received $250,000 to treat drug-exposed babies, and Lowell General Hospital was awarded $999,032. Other awardees include Baystate Medical Center, UMass Memorial Medical Center and Boston Medical Center, all receiving grants of around $250,000.

Beverly’s high need and its goal of reducing length of stay by 30 percent were major factors in the commission’s decision to award it such a large sum, said HPC Executive Director David Seltz.

“The impact of this particular diagnosis is hitting every community across the state, and we need to be able to spread these best practices to community hospitals as well as our big academic medical centers,” Seltz said. “We need to engage these patients in their own communities.”

The plan is the brainchild of Beverly Hospital nurse Nicole Sczekan, who watched her own daughter struggle through three pregnancies while facing addiction.

“Prenatal treatment, behavioral health and addiction medicine are all very different things, all of which are important,” ­Sczekan said. “She had to go to different places to receive each kind of care. It was very frustrating.”

Her daughter, Kaela ­Deschuytner, 25, was hooked on both pills and heroin but is now clean. She said she will eventually be part of Beverly’s program, which will include counseling from “peer moms” who have been through the same experience.

“That’s my goal, to help with the program,” ­Deschuytner said. “Once my mom started this, it made me realize how much my addiction affected not only my life, but her life as well.”