CHICAGO (CBS) — Former Illinois State Rep. Keith Farnham pleaded guilty to child pornography charges on Friday, after reaching a plea agreement with federal prosecutors.

His change of plea came six months after he pleaded not guilty to possessing, receiving and transporting child pornography.

READ MORE: High Ranking Cook County Sheriff's Office Official Resigns Amid Complaints Of Inappropriate, Unsolicited Sexual Comments To Colleague

The Elgin Democrat now faces 5 to 20 years in prison, after pleading guilty to a count of transporting child pornography. Federal sentencing guidelines recommend he serve 14 years.

Farnham, 66, has been fighting bladder cancer, hepatitis, and pulmonary fibrosis, and breathes with the help of an oxygen mask. He was allowed to remain free on electronic monitoring, due to his health.

“What the judge simply did was allow him to remain out on bond, until he’s sentenced, so that we can work then with the Bureau of Prisons, so that when he goes into custody, he’s given reasonable, necessary medical treatment,” Defense attorney Terry Ekl said. “I don’t think any human being should be opposed to making sure that he’s treated for the illnesses that he has. He’s not running from his punishment.”

Transportation of child pornography is considered a violent crime, normally requiring immediate incarceration upon conviction, but U.S. District Judge Edmond Chang allowed Farnham to stay free on bond, so he could continue to receive treatment with an experimental drug for his pulmonary fibrosis.

READ MORE: Another Delay For Bid To Create Database For CPD Misconduct Files As Aldermen Question Cost, Frustrating City's Top Watchdog

“He’s going to go to the penitentiary. That should make all of your listeners happy. He’s going to go to the penitentiary,” Ekl said. “Whether it’s today, or March, really what difference does it make?”

Ekl said Farnham has owned up to his crimes.

“He’s accepted responsibility for his conduct, which we all agree is something that none of us can understand. It’s a sickness,” he said.

Prosecutors said he had more than 2,700 still and video images of child pornography on his home and office computers. Some showed girls as young as two years old crying while they were victimized.

MORE NEWS: Expert Breaks Down The Seconds Before Adam Toledo Was Shot In Body Camera Video

Sentencing has been scheduled for March.