ALBUQUERQUE — It has been almost four decades since Betty Jo Lopez started using heroin.

Her face gray and wizened well beyond her 59 years, Ms. Lopez would almost certainly still be addicted, if not for the fact that she is locked away in jail, not to mention the cup of pinkish liquid she downs every morning.

“It’s the only thing that allows me to live a normal life,” Ms. Lopez said of the concoction, which contains methadone, a drug used to treat opiate dependence. “These nurses that give it to me, they’re like my guardian angels.”

For the last six years, the Metropolitan Detention Center, New Mexico’s largest jail, has been administering methadone to inmates with drug addictions, one of a small number of jails and prisons around the country that do so.

At this vast complex, sprawled out among the mesas west of downtown Albuquerque, any inmate who was enrolled at a methadone clinic just before being arrested can get the drug behind bars. Pregnant inmates addicted to heroin are also eligible.