A Brevard County father charged with locking up his son in a cage and leaving him to starve for months took a plea deal in court Friday.

Michael Marshall told a judge he did it to help his son. Marshall now faces no less than 19 years behind bars, but that's much less than his girlfriend, Sharon Glass, who faces life in prison after she was convicted in January.

Marshall looked very different when he walked into the courtroom Friday. The long hair he had on the night he was arrested in March 2012 was trimmed short, and he appeared very pale.

Nearly two years earlier, Marshall was taken into custody for caging, starving and abusing his son. That abuse included locking the then-12-year-old in a closet or bathroom and, at one point, zip-tying him to a bedpost several times, feeding him only instant potatoes or ramen noodles.

When Titusville police entered Marshall's home in 2012, they said the boy weighed only 40 pounds.

"He was denied access to showers, at times his food was limited to no meals at all," said prosecutor Will Scheiner at Friday's hearing.

Marshall shook his head at times during the hearing.

When the judge asked Marshall why he and Glass did this to his own son, he replied, "She said it would be a good idea to get him rock-bottom. That way he would straighten up."

Marshall said the child was misbehaving, and he and Glass wanted to show him how bad it can get.

"We weren't trying to hurt him. We were trying to help him, but went the wrong way about it," Marshall told the judge.

Marshall faces a minimum of 19 years behind bars, but could get up to 30 due to his plea deal. His sentencing was scheduled for April 4.