The former head of a foundation started by ex-Subway pitchman Jared Fogle was sentenced Thursday to 27 years in prison by a federal judge on child exploitation and child pornography charges.

Russell Taylor, 44, was the executive director of the Jared Foundation, a charity that worked to prevent childhood obesity.

Taylor pleaded guilty Thursday to 12 counts of producing child pornography and one count of distributing it, and then begged for leniency, holding back tears. He apologized to his victims and asked the judge to "not allow me to rot in the landfill of lost souls" with a lengthy prison term.

But Judge Tanya Walton Pratt gave Taylor more than the 15 to 23 years that his attorneys had asked for as part of the plea agreement. He got 27 years for producing child pornography and 20 years for distributing child pornography, and the sentences will be served concurrently.

The Indianapolis man said he has been "falling asleep in a puddle of tears every night" since he was arrested, and told Pratt that she's "never had a prisoner stand in your court more remorseful than I am today," reported the Indianapolis Star.

Related: Jared Fogle, Ex-Subway Pitchman, Gets 15 Years in Prison for Child Porn Charges

Fogle was sentenced to more than 15 years in prison last month on child pornography and sex crime charges, including paying to have sex with minors. Investigators say Taylor secretly recorded images of 12 children, ages 9 to 15, in his home, and then shared the images with Fogle.

Prosecutors last week recommended 35 years, saying Taylor's actions "greatly impacted the lives of 12 children and their families." The minimum sentence under federal law is 15 years.

In court documents, Taylor admitted to using hidden cameras to produce child porn.

Russell Taylor. Uncredited / AP

He said it started by accident when a security camera captured a sexual encounter in his home office, The Associated Press reported. After telling Fogle about the accidental tape, he said the Subway spokesman encouraged him to hide cameras in other areas where "minors would be when either changing clothes or undressing to shower or bathe," according to the court documents.

According to Taylor, Fogle, 38, was psychologically abusive, referring to himself as Taylor's "daddy."

"There would be discussions of how much Mr. Taylor loved 'daddy' and reminding him that 'daddy' was paying for his things," court documents said.

Taylor was the head of Fogle's foundation from 2009 until his arrest in April. Revelations of their illicit actions brought to a shocking end the lucrative career that Fogle had enjoyed as the face of Subway, which started when he was featured in a 2000 commercial touting his weight loss.

Related: Porn-Sniffing Dog Helped Bring Down Subway Star Jared Fogle

As a 425-pound student at Indiana University, Fogle said eating at Subway helped him shed 245 pounds. At his sentencing, a forensic psychiatrist testifying for the defense said Fogle suffered from a compulsive eating disorder and that after losing weight, he substituted food with hypersexuality, including pedophilia.

Working together for the Jared Foundation, Fogle and Taylor visited schools around the country, promoting healthy eating. They met when Taylor was doing work as a youth program manager for the American Heart Association, according to the Indianapolis Star.

Prosecutors had asked for a 12-1/2-year sentence for Fogle, but Judge Pratt slapped a 15-year, 8-month prison term on him.