CHICAGO (CBS) — Former Subway spokesman Jared Fogle has agreed to plead guilty to charges he traveled across state lines to have sex with minors, and received child pornography secretly created by a close friend and employee of Fogle’s charitable foundation, according to court documents released Wednesday.

Fogle appeared in an Indianapolis courtroom on Wednesday, to be advised of his rights. He was placed on home detention and GPS monitoring, pending a formal plea hearing at a later date.

A plea agreement released Wednesday indicates Fogle received multiple images or videos of child pornography from 2011 to 2015 from Russell Taylor, a close friend and former director of Fogle’s charity, the Jared Foundation.

Federal prosecutors allege Fogle knew many of the victims’ names, and in some cases met them at social events in Indiana. Fogle also allegedly knew Taylor was secretly recording those children performing sexually explicit acts. Some of the victims were as young as 6 years old.

Taylor was arrested on multiple child pornography charges about two months before federal agents raided Fogle’s home in Zionsville, Indiana, in July, and discovered a hoard of images and videos Taylor had produced for him.

The child pornography charges involve at least 12 minors, according to the feds.

Between 2010 and 2013, Fogle also allegedly traveled from Indiana to New York City, in order to have sex with two child prostitutes. He allegedly had sex with one 17-year-old girl at the Plaza Hotel in November 2012 and at the Ritz Carlton in January 2013 in exchange for cash. The girl told investigators they had sex three other times in New York when she was only 16.

That victim also told investigators Fogle had sex with another 16-year-old girl in exchange for cash.

The feds alleged Fogle asked both girls “to provide him with access to minors as young as 14 years for purposes of commercial sex acts with him.”

While prosecutors and defense attorneys have not agreed to a specific sentence, federal prosecutors have agreed not to seek a sentence of more than about 12 ½ years, and Fogle has agreed not to seek a sentence of less than 5 years. The child pornography charge carries a maximum sentence of 20 years, and the charge of traveling for sex with a minor carries a maximum sentence of 30 years.

The plea agreement also calls for Fogle to pay $100,000 restitution to each of the 14 victims to pay for them to obtain counseling and treatment.

After his release, Fogle would have to register as a sex offender, would have to enter a treatment program for sexual disorders, and undergo regular lie detector tests. He also would be barred from any unsupervised meetings or activities with any minor, without approval of his probation officer.

Fogle, 37, became a spokesman for Subway after losing more than 200 pounds as a student at Indiana University in Bloomington, in part by regularly eating low-fat sandwiches from the restaurant chain. He had been the public face for Subway for 15 years before the child pornography investigation came to light earlier this year, and Subway suspended its partnership with him in July. Subway has since ended its relationship with Fogle.

Fogle’s wife, Kathy, has released a statement saying she is extremely shocked and disappointed, and plans to divorce her husband.