Bernard L. Madoff, the mastermind of the largest Ponzi scheme in history, said in a court filing on Wednesday that he was dying and asked for an early release from prison.

Mr. Madoff, 81, has less than 18 months to live after entering the final stages of kidney disease, the filing said.

In 2009, Mr. Madoff admitted to running a scheme that bilked thousands of investors out of their cash, wiping out his victims’ savings and destroying lives. He was sentenced to 150 years in federal prison.

“Madoff does not dispute the severity of his crimes, nor does he seek to minimize the suffering of his victims,” his lawyer, Brandon Sample, wrote in the filing. “Madoff humbly asks this court for a modicum of compassion.”