Back in 1984, Congress gave authorities the power to let people out of federal prison early, in extraordinary circumstances, like if inmates were gravely ill or dying. But a new report says the Federal Bureau of Prisons blocks all but a few inmates from taking advantage of "compassionate release."

The federal prisons house more than 218,000 inmates but, on average, they release only about two dozen people a year under the program. By contrast, the state of Texas, no slouch when it comes to tough punishment, let out about 100 people on medical parole last year, researchers say.

"Why are so few people getting out?" asks Jamie Fellner, a senior adviser at Human Rights Watch who helped write the new study. "You have a prison system that is grotesquely overcrowded, you have prisoners who pose no meaningful threat to public safety and yet they're being denied release?"

Fellner says she's convinced the culture of the federal prisons and the Justice Department acts as an iron curtain for all but the sickest inmates — people with less than a year to live, who can't even walk or use the bathroom on their own, let alone commit another crime.

"They're in the business of keeping people in prison," Fellner says. "Not to try to facilitate them getting out, however reasonable or compelling their request might be."

Michael Mahoney made one of those requests. He was convicted of selling drugs to an undercover officer back in 1984, went to prison, got out and went on to build a new life for himself.

But he bought a gun for protection, not understanding he couldn't have one as a convicted felon. When he reported the weapon stolen, Mahoney was sent back to prison on a mandatory 15-year sentence. Behind bars, he started getting sick: hepatitis C, then non-Hodgkin's lymphoma, with tumors growing everywhere.

"He just wanted to come on home and eat barbecue and, you know, die at home, be in his own bed," says his older sister, Dixie Taylor.

Taylor says people at the prison hospital in Kentucky supported his bid for release. So did the warden and officials at a regional site. But when Mahoney's petition got to headquarters, in Washington, D.C., it was denied.

"When he was in the hospital in Lexington and we went to see him, he was handcuffed to the bed, his legs were handcuffed to the bed and he had two guards 24-7 with him," Taylor says.

Taylor says her family had arranged for hospice care for him, and the judge who sentenced her brother even reached out to the prison system to help. But authorities didn't respond, and Mahoney died a few days later, at age 49.

Mary Price, general counsel at Families Against Mandatory Minimums, helped write the new report. She says she's tried to help Mahoney — and many other inmates — win compassionate release.

"We don't sentence people to die alone in prison when we've given them a five-year sentence," she says.

Price says Congress gave judges the authority to make decisions about which prisoners could be released for "extraordinary and compelling" reasons. But under the rules, the Bureau of Prisons has to petition the court first.

And the bureau usually says no — without ever involving the court.

For instance, Price and Fellner say they couldn't find a single case in the last 20 years where prison authorities had granted a compassionate release for an inmate to care for young children after a spouse or partner died, even though Congress and the U.S. Sentencing Commission expressly left open that option.

Joe Bogan, a retired warden in the federal prison system, says he supports the idea of giving more inmates a chance at compassionate release. But they're not easy calls, he says.

"You have to treat inmates equally," Bogan says. "You have to have an egalitarian, if you will, philosophy, so that you try to make the same decision in similarly situated cases."

Federal prison officials sent NPR a statement saying they make each decision on a "case by case basis," keeping public safety in mind.

Advocates at Human Rights Watch and Families Against Mandatory Minimums are calling on the Bureau of Prisons to open up its procedures. And they're asking Congress to pass a law that would allow prisoners to go directly to the courts if the bureau shuts them down.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.