DeFUNIAK SPRINGS — Jason Cody Hughes, a former Little League coach, will spend 40 years in prison for molesting a child and soliciting children for sex.

Hughes, 28, pleaded no contest Thursday to 21 charges in all, ranging from molestation of a child under 12 to using a computer to solicit a parent to allow their child to have sex, according to a news release from the State Attorney’s Office.

He will serve 25 years of his sentence day for day with no gain time.

“Upon the completion of the 40 years, he will be on sex offender probation for the rest of his life and will be required to wear an electronic monitor,” the news release said.

Assistant State Attorney Jennifer Lieb, who prosecuted the case, said her office weighed the impact on the child victim of taking the case to court and discussed options with the victim’s family before agreeing to seek the 40-year sentence.

“We felt this was a sufficient sentence in this case,” Lieb said.

Hughes was arrested in September 2016 after Walton County sheriff’s investigators learned he had been using social media to offer mothers as much as $10,000 to allow him to have sex with their daughters.

Authorities set up a sting after being alerted to Hughes’ solicitations. They found him online and contacted him. He vigorously attempted to solicit a 10-year-old child and sent deputies a photo he said depicted a child performing a sex act on him, reports from 2016 said.

After verifying the solicitations, “investigators with both Walton County Sheriff’s Office and the Department of Children and Families began interviewing children that the defendant had access to, and one child disclosed that she had been molested multiple times,” the State Attorney’s Office said. “The child also disclosed that the defendant had shown her images of child pornography.”

A search of Hughes’ computers uncovered child pornography and evidence of other crimes for which he was charged.

One count Hughes pleaded to was domestic battery strangulation, a charge which arose after sex crime investigators found a computer “chat conversation” in which he boasted of choking his wife into unconsciousness.

The other charges include: three counts of lewd or lascivious molestation of a victim under 12 years old, three counts of promoting sexual performance of a child, 10 counts of possession of child pornography, two counts of using a computer to solicit a parent to consent to sexual conduct of a child, one count of transmission of pornography and one count of showing obscene material to a child.

The Emerald Coast Children’s Advocacy Center also participated in the investigation, according to the State Attorney’s Office.