ALBANY, N.Y. — A group of inmates is suing the New York state prison system over its efforts to crack down on prescription drug abuse, saying they are being forced to live with chronic pain because some medications have become too difficult to get behind bars.

The lawsuit, filed in federal court Monday, takes aim at a policy launched in 2017 that requires an extra layer of approval by senior prison system medical staff before inmates can get prescriptions filled for commonly abused and overused drugs.

In reality, those approvals are rarely given, the lawsuit said, leading to hundreds of prisoners being cut off from drugs used for legitimate medical reasons.

“The wholesale denial of these medications especially effects an already vulnerable population: one that includes patients with severe spinal and neurological issues, phantom pain from amputations, multiple sclerosis and serious, chronic pain,” the lawsuit said.

The Department of Corrections and Community Supervision declined a request for an interview with officials who could discuss the medication policy in detail, but spokesman Thomas Mailey said in a statement that the agency is “committed to battling the opioid epidemic and stemming the tide of addiction which has greatly affected incarcerated individuals in the Department’s custody.”

Eighteen prisoners are listed as plaintiffs in the suit. Many complained about restricted access to two drugs, the opioid painkiller tramadol, sold under the brand name Ultram, and the nerve pain and anti-convulsant medication gabapentin, sold under the brand name Neurontin.

Gabapentin isn’t a controlled substance on the federal level, but a growing number of states have taken steps to more closely monitor its use because of evidence it is being used by huge numbers of opioid addicts to make their high more potent.

It is increasingly being discovered in the blood of people who have fatally overdosed on opioids. Simultaneously, it has become one of the most commonly prescribed drugs in the U.S.

Health officials in several countries have also documented widespread abuse of gabapentin in jails.

The New York lawsuit includes several prisoners who say they need the drug and other painkillers for legitimate reasons

The suit said one of them, Angel Hernandez, 57, had been taking Ultram and Neurontin for years to control pain, numbness and a burning sensation from a degenerative spine problem and other ailments but was cut off from both drugs in 2017.

His “medical records are full of his complaints of severe and unmitigated pain and suffering. Nothing was done,” the lawsuit said.

Another plaintiff in the suit, Wayne Stewart, 40, said he had chronic pain after injuries from a shooting in 2003 that left five bullets lodged in his body, including his head and the base of his spine. The gunshot wounds left him paralyzed from the waist down. He has also suffered from a pelvic bone infection.

The suit said Stewart’s prescription for extended-release morphine was discontinued in favor of a far less potent dose of Percocet, which contains the opioid oxycodone. Then the Percocet prescription was also discontinued without cause.

“To this day, Mr. Stewart continues to live with chronic, untreated pain,” the lawsuit said.

Pain management in prisons and jails is complicated due to concerns of prescription diversion and misuse, said Lipi Roy, a clinical assistant professor at NYU Langone.

Roy described pain as a complex problem with many causes such as injury and emotional trauma, something that makes it difficult to manage and diagnose. She said doctors can use vital signs, a patient’s history and other tools to diagnose pain, but she also noted that health care professionals learn little about pain management during their training.