A man was sentenced to 50 years in prison for killing his ex-wife last month in west suburban Wheaton.

Lee Leinweber, 56, pleaded guilty to first-degree murder Friday morning during a hearing before DuPage County Judge Robert Miller, according to a statement from the DuPage County state’s attorney’s office.

In exchange for his guilty plea, Leinweber agreed to a sentence of 50 years in the Illinois Department of Corrections, which he must serve in its entirety, the state’s attorney’s office said.

On Jan. 30, Leinweber was at his ex-wife’s apartment in the 1300 block of Woodcutter Lane in Wheaton when an argument turned violent, prosecutors said.

He attacked 56-year-old Erin C. Leinweber, beating her in the face and neck, then choking her until she fell to the floor, prosecutors said. Leinweber then dropped his body onto hers, breaking her ribs.

Leinweber then forced a plastic garbage bag into her mouth and placed two garbage bags over her head, prosecutors said. He then got a knife from the kitchen and stabbed her repeatedly.

After the murder, Leinweber stole his ex-wife’s money, credit cards and car, then drove off, prosecutors said.

Erin Leinweber’s body was discovered about 6:45 p.m. Feb. 4, and Lee Leinweber was taken into custody the next day in Ottawa. Prosecutors said he was homeless.

“The fact that Mr. Leinweber has taken responsibility in no way diminishes the grief and loss felt by those who loved Erin,” DuPage County State’s Attorney Robert B. Berlin said in a statement.

“His admission to this brutal crime and fifty-year sentence, essentially a life sentence, will not bring her back,” Berlin continued. “With today’s plea and sentence it is my sincerest hope that those who loved Erin will be able to begin the healing process and perhaps take some solace in knowing that the man who murdered Erin will never enjoy a day of freedom again.”