People hooked on prescription painkillers were able to use a drug at home to curb cravings and prevent abuse while waiting to get in a treatment program, finds a small study that gives hope for a new way to fight the opioid problem.

The drug used in the study is usually only given under supervision of a doctor or in settings like jails or treatment programs, but waiting lists are often months long at many clinics.

"Folks are dying, overdosing, contracting HIV and hepatitis on wait lists," said Stacey Sigmon, a psychologist and drug abuse researcher at the University of Vermont.

She sought a way to tide people over, using a tamper-resistant electronic pill dispenser to allow home use.

The drug, buprenorphine, also sold as Suboxone, attaches to the same brain receptors that opioids like OxyContin, heroin and Vicodin do, so it eases withdrawal symptoms and prevents a "high" if those other drugs are used. Buprenorphine itself is an opioid, so it, too, can be abused at high doses, but it is chemically different and has somewhat less potential for that.

"We programmed the device to make each day's dose only available in a three-hour period," she said. Users had to see researchers regularly for pill counts and drug tests, and got daily phone calls to check on how they were.

Results were dramatic. Of the 25 people given the device, 88 percent tested free of illicit opioids at four weeks. At eight weeks it was 84 percent and at 12 weeks, 68 percent. None of 25 others in the study who got no anti-addiction care tested clean at any point.

"It's a huge effect. It is a remarkable difference in outcomes," said Dr. Nora Volkow, director of the National Institute on Drug Abuse.

A grant from the U.S. government paid for the pilot study; researchers are seeking a larger one now to look at longer home treatment.

Just over half of participants were able to get into a comprehensive addiction treatment program by the end of the pilot trial. Results were reported in a letter in Thursday's New England Journal of Medicine.

In a second letter in the journal, doctors working with the Gloucester, Massachusetts, police department report on a project to curb overdoses — the Angel Program — which offers referral and transportation to treatment programs without arrest.

Gloucester's program averaged more than a case a day in its first year of operation. From June 2015 through last May, 376 people sought help a total of 429 times. About 37 percent of them lived in Gloucester or the surrounding county, 40 percent were from other parts of the state, 17 percent were homeless, and the rest were from other states.

Similar projects have been adopted by 153 other police departments in 28 states, researchers report.