Former Subway sandwich chain pitchman Jared Fogle on Thursday was sentenced to 15-1/2 years in federal prison after pleading guilty to child pornography and sex charges.

Fogle, who became famous after losing weight on a diet that included sandwiches from the fast-food chain, agreed in August to a deal with prosecutors under which he would plead guilty to charges of child pornography and traveling for illicit paid sex with minors.

Fogle agreed in court on Thursday to avoid pornography, get sexual disorder treatment and will be a registered sex offender. U.S. District Judge Tanya Walton Pratt also sentenced him to a lifetime of supervision and a $175,000 fine.

Pratt went beyond what either side wanted: prosecutors had sought a 12-1/2 year sentence, while Fogle’s attorneys had asked for five years.

“The defendant was obsessed with child pornography and sex with minors,” Pratt said. Fogle was remanded to the custody of a U.S. Marshall, and Pratt recommend he go to a federal prison in Littleton, Colorado.

Dr. John Bradford, a forensic psychiatrist testifying for the defense at the sentencing hearing, said Fogle was mostly attracted to older female teenagers 16 and 17 years old, not prepubescent children.

Prosecutors countered the testimony by reading a text from Fogle in which he said he wanted younger prostitutes, “the younger the better.”

Bradford also said Fogle has an alcohol problem, and had a compulsive eating disorder that moved into “hypersexuality” after he lost weight.

HORRIBLE SEX ADDICTION

“He traded a horrible food addiction for a horrible sex addiction,” said defense attorney Jeremy Margolis.

Fogle spent at least $12,000 a year or more on prostitutes, and had a number of extramarital affairs, prosecutors said.

Fogle cried during his statement before sentencing, saying his wife and children would never get over this.

“You gave your wife $7 million, she’ll be okay,” Pratt responded. Fogle’s wife filed for divorce, according to media reports.

Fogle said he now acknowledges that the minors involved had been gravely harmed.

Subway fired Fogle when reports of the plea agreement emerged. He has already begun to pay $1.4 million in restitution to 14 victims who are minors.

The prosecutors’ sentencing recommendation left the door open for further charges against Fogle if other evidence emerges.

Authorities have so far identified 12 victims of child pornography in Indiana, along with two teenage victims of child prostitution in New York, according to court documents.

Fogle obtained and viewed child pornography given to him by his co-conspirator, Russell Taylor, which included homemade material involving victims in Indiana, prosecutors said.

Fogle has stated that he was sexually attracted to children as young as eight years old, the government said.

He will now not be able to work or volunteer with unsupervised minors, and will be able to see his own children only with agreement by all involved.