Bernie Madoff, who once ran the largest Ponzi investment scam in history, has a terminal illness and should be released from prison to live out the remaining months of his life, his attorney told a federal judge Wednesday.

The lawyer, Brandon Sample, said in a court filing that Madoff — who is 81 — is dying of kidney failure, has a host of other medical problems and uses a wheelchair. "After over ten years of incarceration with less than 18 months to live, Madoff humbly asks this court for a modicum of compassion," the brief said.

Madoff pleaded guilty in 2009 to running a massive investment fraud scheme that cheated his clients out of billions of dollars. In imposing the maximum sentence of 150 years in prison, U.S. District Judge Denny Chin called Madoff's scheme "extraordinarily evil."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Download the NBC News app for breaking news

Court documents revealed Wednesday said Madoff sought compassionate release in September from the warden of the federal prison in Butner, North Carolina, but was turned down. "Mr. Madoff was accountable for a loss to investors of over $13 billion. Accordingly, in light of the nature and circumstances of his offense, his release at this time would minimize the severity of his offense," the Bureau of Prisons said in denying the request.

In past years, that would have been the end of the matter, because federal courts were powerless to act on requests for compassionate release that had been denied by prison officials. But Congress changed the law when it passed the First Step Act late in 2018. While it was aimed at reducing sentences for low-level drug offenders, the act also gave courts authority to grant release for health reasons.

"Madoff is an 81-year-old man facing significant health issues who has less than 18 months to live. His weakened and declining physical condition is such that he would pose no danger to anyone," Sample said in a motion presented to Chin.

Sample noted that Bernard Ebbers, the former chief executive of WorldCom, was granted compassionate release in December from his 25-year sentence for securities fraud. He died Sunday at age 78. Even the bomber who brought down TWA Flight 103, killing 270 people, was released from a Scottish prison in 2009 on compassionate grounds, Sample said.

The U.S. Attorney's Office in Manhattan, which prosecuted Madoff, declined to comment.

But one of Madoff's victims, Gregg Felson, said the scam wiped out his savings. "He's terminally ill? I'm terminally broke," Felson told The Washington Post. "He deserves no leniency whatsoever."