BANGOR, Maine — A Hampden man was sentenced Wednesday at the Penobscot Judicial Center to nine years in prison for sex crimes, according to the Penobscot County district attorney.

Earl Huntley, 25, pleaded guilty in August to one count each of gross sexual assault and sexual exploitation of a minor, both Class A crimes, five counts of unlawful sexual contact, all Class B crimes, and one count of possession of sexually explicit material, a Class C crime, R. Christopher Almy said in an email after the sentencing.

In addition to prison time, Huntley was sentenced to a lifetime of supervised release for sex offenders and must register as a sex offender for life.

“We are happy with the sentence,” Almy said in an email. “He is a child sexual predator. We recommended the sentence that [was imposed] in part because it would have been hard for the [young victims] to testify in open court and in front of the child molester.

“It’s understandable that the public would think the offender should get more [time to serve] but at the same time without being able to negotiate the sentence, sometimes you end up causing the victims additional harm by forcing them to talk in a public courtroom,” the prosecutor said. “Lifetime supervision is a hefty sentence.”

If Huntley were to reoffend, he could be sent back to prison for life.

Huntley was arrested in June and charged with the counts to which he pleaded guilty.

Almy said after Huntley’s first court appearance more than 18 months ago that the victims in the case were then 11- and 5-year-old sisters. While their mother was serving a jail sentence, they spent time at the home Huntley shares with his mother, the prosecutor said.

Huntley sexually assaulted both girls and photographed the 5-year-old naked and downloaded the picture to his iPad, Almy said.

Police began investigating after Huntley’s classmates at the Penobscot Job Corps Center in Bangor became concerned about his sexual interest in young children, the prosecutor said. Huntley also allegedly showed classmates child pornography on his iPad.

Huntley had been held since June 2015, unable to post $25,000 cash or $50,000 surety bail, according to personnel at the Penobscot County Jail.

He faced up to 30 years in prison and a fine of up to $50,000 on the Class A crimes, up to 10 years in prison and a fine of up to $20,000 on the Class B offenses and up to five years in prison and a fine of up to $5,000 on the Class C crime.

To reach a sexual assault advocate, call the Statewide Sexual Assault Crisis and Support Line at 800-871-7741, TTY 888-458-5599. This free and confidential 24-hour service is accessible from anywhere in Maine. Calls are automatically routed to the closest sexual violence service provider.