Subway pitchman Jared Fogle

Former Subway spokesman Jared Fogle will spend the next 15 years and 6 months in prison after pleading guilty to possession of child p0rnography and traveling across state lines to solicit minors for sex.

A judge sentenced Fogle on Thursday in an Indianapolis, Indiana courtroom.

Fogle gained fame after he claimed he lost 200 pounds by subsisting on a diet of Subway sandwiches. Subway hired Fogle as a pitchman after his story went viral.

Federal agents raided Fogle’s suburban Indianapolis home in July after a tipster told authorities Fogle possessed child p0rn.

Fogle also agreed to get treatment for his sex addictions; stay away from child p0rn; and register as a sex offender when he is released.

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